-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#25562] CDC: Move restart time forward when there are no writes
Summary: In this diff, we introduce the concept of Virtual WAL Safe time. Virtual WAL safe time is defined as the commit time of the last commit or safepoint record popped from the priority queue. Upon Init VWAL, VWAL safe time is initialised equal to the restart time (record id commit time field of the slot entry). The VWAL safe time moves forward as the streaming progresses. It is the threshold time, whereby the records having commit time lesser than this, if encountered by VWAL, will be filtered out. LSN will not be generated for such filtered records. In addition to this, changes have been introduced in this diff to move the restart time forward when VWAL has received acknowledgement for every record it has shipped. A new tserver flag `cdcsdk_update_restart_time_interval_secs` (default value 1 minute) governs the interval after which we check if the last received restart lsn is same as the last lsn shipped by the VWAL. If these two are found to be equal, then we go ahead and update the restart time to the VWAL safe time. All the maps are updated accordingly and pub refresh times list is trimmed as per the new restart time. The new restart time is also persisted in the slot entry in cdc_state table. All the changes for calculating the VWAL safe time and moving the restart time forward, are guarded by a default true runtime flag `cdcsdk_update_restart_time_when_nothing_to_stream`. Jira: DB-14815 Test Plan: ./yb_build.sh --cxx-test integration-tests_cdcsdk_consumption_consistent_changes-test --gtest_filter CDCSDKConsumptionConsistentChangesTest.TestMovingRestartTimeForwardWhenNothingToStream ./yb_build.sh --cxx-test integration-tests_cdcsdk_consumption_consistent_changes-test --gtest_filter CDCSDKConsumptionConsistentChangesTest.TestVWALSafeTimeWithDynamicTableAddition Reviewers: skumar, siddharth.shah, utkarsh.munjal Reviewed By: siddharth.shah Subscribers: ycdcxcluster Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D41834
- Loading branch information
1 parent
f85bbca
commit a011f3b
Showing
6 changed files
with
283 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.