cockroachdb / cockroachdb/cockroach

logical replication: make column ID mismatch error more actionable

Open
#174,665 1 comment 0 reactions 0 assignees View on GitHub
A-cdc C-enhancement T-cdc
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Is your feature request related to a problem? Please describe.**
In 25.2, a check was introduced to LDR's KV writer that fails when there is a
column ID mismatch between the source and destination tables. For example:

> hit retryable error cannot create logical replication stream: destination
> table ‹...› column ‹...› has ID N, but the source table ‹...› has ID N+1. To
> circumvent this check, unset logical_replication.consumer.immediate_mode_writer
> from 'legacy-kv'

The only workaround the message suggests is unsetting the `legacy-kv`
`logical_replication.consumer.immediate_mode_writer`.

**Describe the solution you'd like**
Make the error message more actionable by pointing to additional ways to resolve
the issue, such as recreating the logically replicated table so the column IDs
align, or ignoring the mismatch where it is safe to do so.

**Additional context**
https://cockroachlabs.slack.com/archives/C9TGBJB44/p1788204876352469

Jira issue: CRDB-67862

Contributor guide

Open the contributing guide

Research direction

Start by locating the quoted column ID mismatch error in the logical replication KV writer and read the surrounding validation and error-handling code. Review the linked context and existing logical replication guidance before deciding which recovery options are safe to mention. Done means the error explains the applicable ways to resolve or safely bypass the mismatch without suggesting an unsafe workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.