Skip to content

Commit

Permalink
[BACKPORT 2.20][#18934] CDCSDK: Fix failing TestReleaseResourcesOnUnp…
Browse files Browse the repository at this point in the history
…olledSplitTablets test

Summary:
Original commit: 9c370a0 / D31702
In https://phorge.dev.yugabyte.com/D30918, we introduced support for rolling back a failed CDC stream.

As part of the rollback revision, we enabled the UpdatePeersAndMetrics thread earlier in the flow (SetCDCServiceEnabled()). The test
TestReleaseResourcesOnUnpolledSplitTablets started intermittently failing. The failure happens because the UpdatePeersAndMetrics thread was caching the stream metadata
without the stream creation time.

The fix is to make the UpdatePeersAndMetrics thread refresh the cached stream metadata if the state is in Initialized state.
Jira: DB-7785

Test Plan:
Jenkins: test regex: .*CDCSDK.*

./yb_build.sh --cxx-test cdcsdk_consistent_snapshot-test --gtest_filter CDCSDKConsistentSnapshotTest.TestReleaseResourcesOnUnpolledSplitTablets -n 5

Reviewers: asrinivasan, skumar

Reviewed By: asrinivasan

Subscribers: ycdcxcluster

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D31806
  • Loading branch information
dr0pdb committed Jan 19, 2024
1 parent be4f591 commit 1aac3ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/yb/cdc/cdc_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3415,7 +3415,8 @@ Status CDCServiceImpl::CheckTabletNotOfInterest(
bool deletion_check) {

// This is applicable only to Consistent Snapshot Streams,
auto record = VERIFY_RESULT(GetStream(producer_tablet.stream_id));
auto record = VERIFY_RESULT(
GetStream(producer_tablet.stream_id, RefreshStreamMapOption::kIfInitiatedState));
if (!record->GetSnapshotOption().has_value() || !record->GetStreamCreationTime().has_value()) {
return Status::OK();
}
Expand Down

0 comments on commit 1aac3ef

Please sign in to comment.