[fix](backup) Strip replica info from backup meta#65321
Open
Ryan19929 wants to merge 1 commit into
Open
Conversation
### What problem does this PR solve? Issue Number: N/A Related PR: apache#63 Problem Summary: Backup meta currently persists every Replica object of each backed up tablet. For large tables this amplifies the metadata size and FE memory footprint, while restore does not use those replica objects because replicas are recreated from restore replica allocation and selected backends. Add a mutable config to keep the old behavior when needed, and strip replica info from detached backup table copies by default. ### Release note Reduce FE memory usage and backup meta size for BACKUP jobs by omitting unused replica information from backup metadata by default. ### Check List (For Author) - Test: Unit Test - ./run-fe-ut.sh --run org.apache.doris.catalog.OlapTableTest#testSelectiveCopyBackupReplicaStripping - git diff --check - Behavior changed: Yes (backup meta no longer persists replica info by default; controlled by backup_meta_reserve_replica_info) - Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
FE Regression Coverage ReportIncrement line coverage |
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: close #xxx
Related PR: #xxx
Problem Summary:
Historical Context
Backup metadata has stored the full
Tableobject since the original backup/restore implementation was introduced in #224. As a result, Replica objects were included implicitly through the catalog object hierarchy:OlapTable -> Partition -> MaterializedIndex -> Tablet -> ReplicaThey were not added as a dedicated backup metadata object.
A later restore enhancement, #11942, introduced the
reserve_replicaproperty. That feature preserves the original replication allocation when requested, but it does not require preserving individual serialized Replica objects. During restore, Doris still recreates tablets and replicas with new ids and selected backend ids.Background
Large BACKUP jobs can generate very large backup metadata because Doris currently persists all Replica objects for every backed up tablet. For tables with many tablets and replicas, this increases both backup metadata size and FE memory usage.
Root Cause
Backup metadata currently stores a detached copy of the full table metadata. Since Tablet metadata contains Replica objects, all replicas are serialized into backup metadata as part of the table object graph.
This is unnecessary for restore. Restore only needs the table structure, partition/index/tablet topology, version information, and replica allocation. The actual Replica objects are recreated during restore with new replica ids and selected backend ids.
Changes
This PR strips replica information from the detached table copy used for backup metadata.
A mutable FE config
backup_meta_reserve_replica_infois added as a fallback. The default value isfalse, which omits unused replica information from backup metadata. Setting it totruepreserves the old behavior.Follow-up Work
This PR only addresses replica-info amplification in backup metadata. Follow-up PRs will handle larger serialization optimizations:
snapshotInfosandrestoredVersionInfo.Compatibility
Restore compatibility is kept because RESTORE does not depend on serialized Replica objects. The previous behavior can still be restored with
backup_meta_reserve_replica_info.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)