forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yugabyte#15154] CDCSDK: Before image failure with packed row
Summary: With packed row enabled, if the current schema version is different than before the image schema version, DocDB will fail to decode the packed row. For example:- 1. Enable packed row. 2. Create a table with 2 columns. So the schema version is V1. 3. No insert one record into the table. 4. Do ALTER of the table by adding a new column, so the total columns in the table are 3. Here the schema version is V2. 5. Now update the record that is inserted in step 2. Now call GetChanges with the before image enabled. Today the scenario is failing because the before image is in V1 version and the schema version CDC provides to read the before image is V2. During analysis, we found that CDC uses// docdb::DocRowwiseIterator //with the corresponding schema to read rows from DocDB. Method //DocRowwiseIterator::HasNext// is used to get the next row from DocDB, which internally calls the Prepare() method of doc_reader to check the row type it reads from DocDB. If the type of row is ValueEntryType::kPackedRow it checks the packed row’s schema version vs the input schema version, if there is a mismatch it throws an error. To handle this we will use the current running schema version to fetch the before image row from the DocDb, if it fails to get the row, CDC will ignore adding the before image record for the corresponding change records. Test Plan: Running all the before image unit testcases with packed row enabled Reviewers: skumar, srangavajjula, abharadwaj Reviewed By: abharadwaj Subscribers: ycdcxcluster Differential Revision: https://phabricator.dev.yugabyte.com/D21434
- Loading branch information
1 parent
644709b
commit 524fd98
Showing
2 changed files
with
25 additions
and
18 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