Skip to content

Commit

Permalink
[#25752] CDC: Stop sending cleanup rpc to master for logical replication
Browse files Browse the repository at this point in the history
Summary:
Update Peers and Metrics thread periodically reads the state table and identifies expired / not of interest tables. A list of such tables is sent to the master in an rpc. Master than performs a cleanup operation, moving these tables to unqualified list and setting their checkpoint to max. However this cleanup is performed only for tables under gRPC replication. The list sent by update peers and metrics can contain tables under logical replication.

This diff introduces changes to not add the expired / not of interest table to the list to be sent to the master if they belong to logical replication.
Jira: DB-15042

Test Plan: Existing tests

Reviewers: skumar, siddharth.shah

Reviewed By: siddharth.shah

Subscribers: ycdcxcluster

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D41493
  • Loading branch information
Sumukh-Phalgaonkar committed Jan 28, 2025
1 parent dd65f58 commit 5ccee81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/yb/cdc/cdc_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2555,7 +2555,8 @@ void CDCServiceImpl::ProcessEntryForCdcsdk(
if (!status.ok()) {
// If checkpoint is max, it indicates that cleanup is already in progress. No need to add
// such entries to the expired_tables_map.
if (expired_tables_map && checkpoint != OpId::Max()) {
if (expired_tables_map && checkpoint != OpId::Max() &&
!IsReplicationSlotStream(stream_metadata)) {
AddTableToExpiredTablesMap(tablet_peer, stream_id, expired_tables_map);
}

Expand All @@ -2572,7 +2573,8 @@ void CDCServiceImpl::ProcessEntryForCdcsdk(
if (!status.ok()) {
// If checkpoint is max, it indicates that cleanup is already in progress. No need to add
// such entries to the expired_tables_map.
if (expired_tables_map && checkpoint != OpId::Max()) {
if (expired_tables_map && checkpoint != OpId::Max() &&
!IsReplicationSlotStream(stream_metadata)) {
AddTableToExpiredTablesMap(tablet_peer, stream_id, expired_tables_map);
}

Expand Down

0 comments on commit 5ccee81

Please sign in to comment.