Skip to content

CDC - multitable changefeeds may remake pts records unnecessarily #151690

@aerfrei

Description

@aerfrei

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 '&{<nil> 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cdcChange Data CaptureC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-cdcbranch-masterFailures and bugs on the master branch.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions