JingsongLi commented on code in PR #1454:
URL: https://github.com/apache/paimon-rust/pull/1454#discussion_r4674610138
##########
crates/paimon/src/table/table_commit/auto_maintenance.rs:
##########
@@ -312,7 +319,79 @@ impl TableCommit {
{
return Ok(());
}
- let executor = builder.new_auto_executor()?;
+ let overwrite_l0 = if let Some(latest) = dv_snapshot {
+ let active =
crate::table::snapshot_manifest::read_snapshot_entries(
+ &compact.snapshot_manager,
+ latest,
+ None,
+ )
+ .await?;
+ let active = active
+ .iter()
+ .map(|entry| {
+ let partition = if
compact.table.schema().partition_keys().is_empty() {
+ EMPTY_SERIALIZED_ROW.as_slice()
+ } else {
+ entry.partition()
+ };
+ (
+ (
+ partition,
+ entry.bucket(),
+ entry.total_buckets(),
+ entry.file().file_name.as_str(),
+ ),
+ entry.file(),
+ )
+ })
+ .collect::<HashMap<_, _>>();
+ // Refresh DV masks and retained runs, suppressing changelogs
only
+ // for original L0 inputs whose complete metadata is still
active.
+ let mut files = OverwriteL0Files::new();
+ let mut buckets = CompactBuckets::new();
+ for task in plan.tasks() {
+ for file in task.files().iter().filter(|file| file.level
== 0) {
+ if active
+ .get(&(
+ task.partition(),
+ task.bucket(),
+ task.total_buckets(),
+ file.file_name.as_str(),
+ ))
+ .is_some_and(|current| *current == file)
+ {
+ files.insert((
+ task.partition().to_vec(),
+ task.bucket(),
+ file.file_name.clone(),
+ ));
+ buckets.insert((
+ task.partition().to_vec(),
+ task.bucket(),
+ task.total_buckets(),
+ ));
+ }
+ }
+ }
+ if files.is_empty() {
Review Comment:
I reran this through the public write, compaction and incremental read APIs
on `bb05f819` merged with current `main`. The new
`dv_overwrite_retry_preserves_append_that_already_compacted` test filters to
key 2 before asserting. With the full stream, an append of key 2 still emits
`[(+I, 1, 10), (+I, 2, 20)]` after a reader has already bootstrapped with `(1,
10)` from the durable overwrite. I also appended a new value for key 1 in the
same sequence. The new snapshot contains `(1, 11)`, but the incremental stream
reports only `(+I, 1, 11)` instead of an update to the visible key. The
checked-in PK, REST and overwrite-recovery integration suites pass. Please
assert the complete changelog and carry the overwrite inputs’ publication
provenance into any competing lookup compaction.
--
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]