Search before asking
Version
Whats Wrong?
Local backup snapshots are indexed in FE memory only by the bare snapshot label.
The current implementation keeps local snapshots in BackupHandler.localSnapshots as Map<String, BackupJob> and getSnapshot RPC also looks up the snapshot only by request.label_name.
As a result, local snapshots from different databases can collide when they use the same label:
- creating a later local snapshot with the same label can overwrite the previous one in FE memory;
getSnapshot may return the snapshot from another database;
- eviction or removal may also affect the wrong snapshot entry.
This is not just a path naming issue. Although local staging directories include label + "__" + createTime and remote job-info files include timestamps, the in-
Seakup key is still only the bare label.
What You Expected?
Local backup snapshots should be uniquely identified by database scope, for example (dbId, label) or an equivalent key that matches the SQL semantics of db.label.
getSnapshot should use the database dimension from the request when resolving a local snapshot, instead of looking up by bare label only.
How to Reproduce?
- Create database
db1 and database db2.
- Create one local backup snapshot in
db1 with label same_label.
- Create another local backup snapshot in
db2 with the same label same_label.
- Call the local snapshot retrieval path for
db1.same_label and db2.same_label.
Expected:
Each database resolves its own local snapshot.
Actual:
The FE local snapshot map is keyed only by label, so one snapshot can overwrite the other and the lookup can resolve the wrong snapshot.
Anything Else?
Relevant code paths:
fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.java
fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
fe/fe-core/src/main/java/org/apache/doris/analysis/AbstractBackupStmt.java
fe/fe-core/src/main/java/org/apache/doris/analysis/LabelName.java
This issue is intentionally tracked separately from the recent staging-directory cleanup changes, because it is a distinct correctness problem and should be fixed in a focused PR.
Are you willing to submit PR?
Code of Conduct
Search before asking
Version
Whats Wrong?
Local backup snapshots are indexed in FE memory only by the bare snapshot label.
The current implementation keeps local snapshots in
BackupHandler.localSnapshotsasMap<String, BackupJob>andgetSnapshotRPC also looks up the snapshot only byrequest.label_name.As a result, local snapshots from different databases can collide when they use the same label:
getSnapshotmay return the snapshot from another database;This is not just a path naming issue. Although local staging directories include
label + "__" + createTimeand remote job-info files include timestamps, the in-Seakup key is still only the bare label.
What You Expected?
Local backup snapshots should be uniquely identified by database scope, for example
(dbId, label)or an equivalent key that matches the SQL semantics ofdb.label.getSnapshotshould use the database dimension from the request when resolving a local snapshot, instead of looking up by bare label only.How to Reproduce?
db1and databasedb2.db1with labelsame_label.db2with the same labelsame_label.db1.same_labelanddb2.same_label.Expected:
Each database resolves its own local snapshot.
Actual:
The FE local snapshot map is keyed only by
label, so one snapshot can overwrite the other and the lookup can resolve the wrong snapshot.Anything Else?
Relevant code paths:
fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.javafe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.javafe/fe-core/src/main/java/org/apache/doris/analysis/AbstractBackupStmt.javafe/fe-core/src/main/java/org/apache/doris/analysis/LabelName.javaThis issue is intentionally tracked separately from the recent staging-directory cleanup changes, because it is a distinct correctness problem and should be fixed in a focused PR.
Are you willing to submit PR?
Code of Conduct