cockroachdb / cockroachdb/cockroach

Per table PTS breaks for column families

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

Description

Introduced in https://github.com/cockroachdb/cockroach/pull/152917

Based on my analysis:

1. **The assertion `if targets.Size != 1` is factually incorrect** - CockroachDB changefeeds support multiple column family targets per table, which is a documented and tested feature.

2. **This will cause runtime failures** - When a changefeed is configured to watch multiple column families from the same table, `EachHavingTableID` will add multiple targets to the `targets` variable, making `targets.Size > 1`, triggering the assertion failure.

3. **This affects a valid, supported configuration** - The ability to watch specific column families within a table is not an edge case but a legitimate feature of CockroachDB changefeeds.

4. **The failure mode is a panic/crash** - The code uses `errors.AssertionFailedf` which will cause the changefeed to fail with an assertion error rather than gracefully handling the multiple targets.

5. **This represents a regression** - The original code correctly handled multiple targets per table without any count restrictions.

The previous analyses were correct. This assertion fundamentally misunderstands the changefeed target model and will cause production failures for users who rely on column family-specific changefeeds.

Incorrect assertion in createPerTablePTSTarget function will cause changefeed failures when processing tables with multiple column family targets. The assertion assumes exactly one target per table, but changefeeds can legitimately watch multiple column families from the same table. This will cause runtime assertion failures for valid user configurations, representing a regression from the previous working implementation.

Epic: CRDB-1421
https://cockroachlabs.atlassian.net/browse/CRDB-1421

Jira issue: CRDB-54779

Contributor guide

Open the contributing guide

Research direction

Start at the createPerTablePTSTarget function and inspect the assertion that requires targets.Size to equal 1. Trace how EachHavingTableID populates targets for multiple column family targets, then reproduce the failure with a changefeed configuration covering multiple column families. Done means valid multi-family changefeeds no longer fail with an assertion error and coverage verifies the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.