cockroachdb / cockroachdb/cockroach
CDC - multitable changefeeds may remake pts records unnecessarily
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Describe the problem**
As part of managing protected timestamps, we check to make sure the targets/tables we're protecting are up to date with those in the changefeed spec (I believe this is for the case that we update what tables a changefeed is watching is changed in an alter changefeed statement). This check is sensitive to what order the tables are in and that order is non-deterministic. If the protected tables are not in sync with the changefeed targets, we remake the pts records. This means that over time we should expect changefeeds watching multiple tables to remake their pts records regularly, even if the tables that feed is watching remain constant.
**To Reproduce**
Modify the TestChangefeedProtectedTimestampUpdate test to create and watch a second table. Run the test under stress and it will fail with `changefeed_test.go:11861: error scanning '&{ 0x1400783a000}': sql: no rows in result set` rather quickly.
**Expected behavior**
I would expect that a changefeed should only remake pts records if the target information has changed (e.g. if a feed has been altered to watch a new table).
Jira issue: CRDB-53420
Contributor guide
Assessment
This issue has not been assessed yet.