Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CDC] Clean up cdc_state rows for deleted streams #2529

Closed
ndeodhar opened this issue Oct 7, 2019 · 1 comment
Closed

[CDC] Clean up cdc_state rows for deleted streams #2529

ndeodhar opened this issue Oct 7, 2019 · 1 comment
Assignees
Labels
area/cdc Change Data Capture

Comments

@ndeodhar
Copy link
Contributor

ndeodhar commented Oct 7, 2019

When a CDC stream is deleted, corresponding rows for it from cdc_state table should be deleted.

@ndeodhar ndeodhar added the area/cdc Change Data Capture label Oct 7, 2019
@ajcaldera1
Copy link
Contributor

I have an additional requirement for this task. We should clean up the metrics when a CDC stream is deleted as well, otherwise it is difficult to tell which stream is active from the metrics point of view, since there will be multiple copies of metrics for the same tablet.

hectorgcr added a commit that referenced this issue Feb 12, 2020
Summary:
Clean up cdc_state rows for deleted streams.

Also, modify catalog manager methods `DeleteCDCStreamsForTables` and `DeleteCDCStream` so that they don't remove the stream entries from the sys catalog and the streams map. Instead, these methods just mark the streams as DELETING, and the catalog manager background thread is responsible for cleaning up these entries. The cleaning up method `DeleteCDCStreams` is responsible for deleting the stream entries from the `cdc_state` table.

Test Plan: Added more code to TestDeleteCDCStream to verify that the stream entries from cdc_state table are deleted once the stream is deleted

Reviewers: rahuldesirazu, nicolas, bogdan, neha

Reviewed By: neha

Subscribers: bogdan, ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D7376
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cdc Change Data Capture
Projects
None yet
Development

No branches or pull requests

3 participants