QuakeWang commented on code in PR #1454:
URL: https://github.com/apache/paimon-rust/pull/1454#discussion_r4675015741
##########
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:
You're right, the key 2 assertion missed both cases. I reproduced them on
upstream `main` (`e7e9a4dc`) without #1454: an unchanged key was emitted again
as `+I`, and updating an existing key also produced `+I`.
I opened #1525 for the overwrite publication fix. Its test checks the full
changelog, including the `-U`/`+U` pair. Could you take another look at #1454
for the stale same-bucket PK DV compaction check and recovery of surviving
overwrite L0 files?
--
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]