SteNicholas commented on code in PR #357: URL: https://github.com/apache/paimon-cpp/pull/357#discussion_r4033766947
########## docs/source/user_guide/catalog.rst: ########## @@ -224,7 +222,73 @@ restored by ``RollbackToAsLatest``. Serialize rollback and expiration through the upstream coordinator: a rollback must finish before expiration starts, so its restored file references are visible to the expiration operation. +.. warning:: + + Expiration reads the retained snapshots of the branch it runs on and of no + other, while data files are shared by every branch of the table, so a file + that only another branch still refers to is not preserved by that reference + and is deleted. This holds for the main branch as much as for the others: + expiring the main branch deletes a file only a branch refers to. Expire only + where the retained snapshots of the branch cover every file the other branches + still read, or keep those files reachable from the expiring branch through the + upstream coordinator. + Review Comment: Done in 0af0eea. `Expire()` now returns `NotImplemented` before reading any snapshot or deleting any file when it runs on a branch other than main, or when it runs on main and finds another branch under `branch/branch-<name>` of the table path; that error lists the branches found. A branch held only by a catalog, or one created while expiration runs, is not found by this check, so `FileStoreCommit::Expire()` and the catalog and clean guides call that out and ask to serialize branch creation and expiration. `TestExpireOnBranchIsNotSupported` and `TestExpireOnMainOfTableWithBranchesIsNotSupported` cover each refusal and check that no snapshot, manifest or data file is deleted. -- 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]
