Skip to content

[fix](fe) Preserve config for replace table binlogs - #66930

Open
goutamadwant wants to merge 1 commit into
apache:masterfrom
goutamadwant:fix-replace-table-binlog-config
Open

[fix](fe) Preserve config for replace table binlogs#66930
goutamadwant wants to merge 1 commit into
apache:masterfrom
goutamadwant:fix-replace-table-binlog-config

Conversation

@goutamadwant

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: close #66571

Related PR: None

Problem Summary:

When database-level binlog is disabled and only the original table has binlog enabled, a swap=false REPLACE TABLE can skip its binlog after an FE restart or failover. The original table is removed before a cold BinlogConfigCache can resolve its configuration.

This change captures the original table's BinlogConfig before replacement and persists it in ReplaceTableOperationLog. Live emission, follower replay, table-level GC settings, and image recovery use that snapshot. Image recovery pre-processes one existing database region at a time before filtering table dummies, while missing databases and disabled-binlog images remain streaming. Legacy logs without a snapshot retain their previous behavior.

Release note

Fix missing REPLACE TABLE binlogs when only table-level binlog is enabled and the FE binlog config cache is cold.

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes. REPLACE TABLE now preserves the original table's binlog configuration for emission and recovery.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: close apache#66571

Related PR: None

Problem Summary: With database binlog disabled, a swap=false REPLACE TABLE could skip the table-level binlog after a cold-cache restart because the original table was removed before its configuration was resolved. Capture the original table binlog configuration before replacement, persist it in the operation log, and restore it for live emission, replay, garbage collection, and image recovery. Legacy logs without a snapshot keep their previous behavior.

### Release note

Fix missing REPLACE TABLE binlogs when only table-level binlog is enabled and the FE binlog config cache is cold.

### Check List (For Author)

- Test: Unit Test
- Behavior changed: Yes. REPLACE TABLE now preserves the original table binlog configuration for emission and recovery.
- Does this need documentation: No
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] REPLACE TABLE may skip binlog on master FE when only table-level binlog is enabled

2 participants