QuakeWang commented on code in PR #522:
URL: https://github.com/apache/paimon-rust/pull/522#discussion_r3594255028
##########
crates/paimon/src/table/table_commit.rs:
##########
@@ -511,12 +579,23 @@ impl TableCommit {
/// Truncate the entire table (OVERWRITE with no filter, only deletes).
pub async fn truncate_table(&self) -> Result<()> {
- self.truncate_table_with_identifier(BATCH_COMMIT_IDENTIFIER)
+ self.truncate_table_impl(BATCH_COMMIT_IDENTIFIER, false)
.await
}
/// Truncate the entire table with a caller-provided commit identifier.
+ ///
+ /// A previously committed identifier is filtered so retrying an uncertain
+ /// result cannot delete data committed in between.
pub async fn truncate_table_with_identifier(&self, commit_identifier: i64)
-> Result<()> {
+ self.truncate_table_impl(commit_identifier, true).await
Review Comment:
When the first identified truncate is a no-op on an already-empty table,
`try_commit` exits without writing a snapshot, so the identifier is never
recorded. Retrying the same identifier after another writer appends data is not
filtered and deletes the intervening data.
--
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]