[fix](binlog) Support hidden key columns in row binlog#65076
Open
seawinde wants to merge 1 commit into
Open
Conversation
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary: Row binlog schema and BE writer previously treated normal row-binlog columns as visible source columns only. Tables that contain hidden key columns need those key columns to be included in row-binlog normal columns while still skipping hidden non-key internal columns. This change makes FE row-binlog schema generation and schema-change sync include visible columns plus hidden key columns, and updates BE row-binlog writing to use the same source-schema prefix contract.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- ./run-fe-ut.sh --run org.apache.doris.catalog.OlapTableRowBinlogSchemaTest,org.apache.doris.alter.SchemaChangeHandlerTest
- ./build-support/check-format.sh
- git diff --check
- Behavior changed: No
- Does this need documentation: No
Member
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 29883 ms |
Contributor
TPC-DS: Total hot run time: 174988 ms |
Contributor
ClickBench: Total hot run time: 25.39 s |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: N/A
Related PR: #63110
Problem Summary:
Row binlog schema and the BE row-binlog writer previously treated normal row-binlog columns as visible source columns only. This misses hidden key columns, while hidden non-key internal columns such as sequence/delete/version/skip-bitmap columns should still be excluded from row binlog.
Root cause: In
OlapTable.generateTableRowBinlogSchema()andSchemaChangeHandler.addColumnRowBinlog(), FE generated and maintained row-binlog schema from visible columns only. InRowBinlogSegmentWriter/RowBinlogSourceDataWriter, BE also used visible-column counts to map source columns to row-binlog normal columns.This PR makes row-binlog normal columns follow a simple source-schema prefix contract: visible columns plus hidden key columns are written, and trailing hidden non-key columns are skipped. FE schema generation and add-column schema-change sync now use this contract. BE row-binlog writing uses the same normal-column count for full writes, partial update filtering, key column materialization, and BEFORE value columns.
OlapTable.javaSchemaChangeHandler.javarow_binlog_segment_writer.*Release note
Fixed an issue where row binlog did not include hidden key columns in the row-binlog schema and write path.
Check List (For Author)
Test
./run-regression-test.sh --run -d row_binlog_p0 -s test_row_binlog_hidden_column_schema -forceGenOut./run-fe-ut.sh --run org.apache.doris.catalog.OlapTableRowBinlogSchemaTest,org.apache.doris.alter.SchemaChangeHandlerTestPATH=/home/seawinde/apache-maven-3.9.12/bin:$PATH ./run-be-ut.sh --run --filter=RowBinlogSourceDataWriterTest.* -j20./build-support/check-format.shgit diff --checkBehavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)