-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#22273] CDCSDK: Fix the segmentation fault in walsender for dynamic …
…table addition Summary: When the walsender starts, in the `ReplicationSlotAcquire()` function, we fetch and store the replica identities of all the tables in the publication at that time in a hash table. These stored replica identities are used for decoding of records. However, the replica identities of the tables added dynamically to the publication while streaming is in progress are not added to this hash table. As a result a segmentation fault was observed while decoding the records belonging to these tables. This diff fixes this issue by refreshing the stored replica identities while handling the dynamic table addition / removal. This way we update the stored replica identities before decoding the records belonging to dynamically added tables. In addition to this, this diff also introduces changes to avoid a possible race condition when a dynamic table is created. This race condition could occur when the walsender tries to process the publication refresh while the master background task is yet to add the dynamically created table to the stream metadata, causing the walsender to crash. In order to handle this, when the `UpdatePublicationTableList` rpc is called, we get the stream metadata and verify that all the table_ids sent by the walsender are present in stream metadata. In walsender, the replica identities will be refreshed only after we return from `UpdatePublicationTableList`. This will ensure that the background task has done its job of adding replica identity and table id to stream metadata before we fetch this information . Jira: DB-11189 Test Plan: Jenkins: test regex: .*CDCSDKConsumptionConsistentChangesTest.*|.*ReplicationSlot.* ./yb_build.sh --java-test 'org.yb.pgsql.TestPgReplicationSlot#testDynamicTableAdditionForAllTablesPublication' ./yb_build.sh --cxx-test integration-tests_cdcsdk_consumption_consistent_changes-test --gtest_filter CDCSDKConsumptionConsistentChangesTest.TestDynamicTablesAdditionForTableCreatedAfterStream Reviewers: asrinivasan, skumar, stiwary Reviewed By: stiwary Subscribers: yql, ycdcxcluster Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D34788
- Loading branch information
1 parent
0dc50d0
commit d572645
Showing
6 changed files
with
90 additions
and
22 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
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