cockroachdb / cockroachdb/cockroach

crosscluster/logical: handle PIT LDR cursor before schema changes

Open
#164,290 2 comments 0 reactions 0 assignees View on GitHub
A-cdc T-cdc
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The following is not working as intended.

1. Set `ts = s.Clock().Now()`
2. Add column to table `t`
3. Insert row into `t`
4. Start LDR stream with `t` as target, cursor = `ts`
5. The row added in step 2 is never replicated, and will see something like
```
I260224 18:04:14.748518 6879 crosscluster/logical/logical_replication_job.go:944 [T10,Vtest-tenant,n1,job=LOGICAL REPLICATION id=1153059568756228097] 513 hit retryable error cannot create logical replication stream: destination table tab has 3 columns, but the source table tab has 2 columns
```

We need to handle the case where the descriptor is older than any schema changes so that it can be replicated correctly. If the dest schema has extra columns we insert the default value, if they have less columns we remove them.

Jira issue: CRDB-60736

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.