thswlsqls opened a new issue, #9867: URL: https://github.com/apache/paimon/issues/9867
**Search before asking** - [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar. **Paimon version** master @ bbae07d37 / 2.2-SNAPSHOT **Compute Engine** Engine-agnostic (core); surfaces via Flink/Spark rollback procedures **Minimal reproduce step** 1. Create a primary-key table, commit once on main. 2. `table.createBranch("branch1")`, `branchTable = table.switchToBranch("branch1")`, commit once. 3. `branchTable.createTag("branch_tag", 1)`, then commit twice more. 4. Expire with `snapshot.num-retained.min/max = 1` via `branchTable.newCommit("").expireSnapshots()`. 5. Read `branchTable.copy(scan.tag-name = branch_tag)`: fails with `FileNotFoundException: manifest-list-...`. Cause: `AbstractFileStore.newTagManager()` (line 369) passes `DEFAULT_MAIN_BRANCH` to `TagManager`, while `snapshotManager()` (line 190) and `AbstractFileStoreTable.tagManager()` (line 817) use the table branch. `newExpireSnapshots()` (line 485) hands that main-branch manager to `ExpireSnapshotsImpl.collectTaggedSnapshots()` (line 454), which never sees branch tags. **What doesn't meet your expectations?** Branch tags should protect their snapshots, as on main. Instead the tagged snapshot's manifest list and data files are deleted. **Anything else?** Same root cause: automatic tags and `_SUCCESS` files of branch tables land in the main `tag/` directory, and Flink `RollbackToProcedure` (line 72), `RollbackToAsLatestProcedure` (line 87) and Spark `RollbackProcedure` (line 116) cannot find branch tags. #9044 fixed the same pattern in `StaticFromTagStartingScanner`. **Are you willing to submit a PR?** - [x] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
