From f4a5e3f3dd00692203ef38f4592fa0c769af0ad9 Mon Sep 17 00:00:00 2001 From: Nelson Boss Date: Wed, 2 Sep 2026 00:41:19 +0800 Subject: [PATCH] [fix](test) Align two UT assertions with current master behavior IcebergWritePlanProviderTest asserts baseSnapshotId == null for an explicitly pinned empty read, but #66348 intentionally changed this to keep the pinned -1 as an OCC fence; the test from #66345 was not updated. PropertyAnalyzerTest expects the partition-level "only supports V2, V3 and SNII" message for V1, but #64522 already throws the "deprecated" message inside analyzeInvertedIndexFileStorageFormat before the partition-level check can run, making the expected branch unreachable. Update the Iceberg assertion to expect -1 (matching the intent documented in #66348), and accept either V1-rejection message in the PropertyAnalyzer assertion. Test-only, no production code changed. --- .../connector/iceberg/IcebergWritePlanProviderTest.java | 7 +++++-- .../java/org/apache/doris/common/PropertyAnalyzerTest.java | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/fe/fe-connector/fe-connector-iceberg/src/test/java/org/apache/doris/connector/iceberg/IcebergWritePlanProviderTest.java b/fe/fe-connector/fe-connector-iceberg/src/test/java/org/apache/doris/connector/iceberg/IcebergWritePlanProviderTest.java index ad03f8a0a2039b..4e732eecfa59f9 100644 --- a/fe/fe-connector/fe-connector-iceberg/src/test/java/org/apache/doris/connector/iceberg/IcebergWritePlanProviderTest.java +++ b/fe/fe-connector/fe-connector-iceberg/src/test/java/org/apache/doris/connector/iceberg/IcebergWritePlanProviderTest.java @@ -1724,8 +1724,11 @@ public void planMergePreservesExplicitlyEmptyReadAcrossConcurrentFirstAppend() { providerFor(ops.table, ctx).planWrite(new WriteSession(txn), new WriteHandle(emptyPinnedHandle).writeOperation(WriteOperation.MERGE)); - Assertions.assertNull(txn.getBaseSnapshotId(), - "an explicitly empty read must leave RowDelta validation unbounded across the first append"); + // #66348: an explicitly pinned -1 (the empty-table generation) stays on baseSnapshotId as an + // OCC fence — the RowDelta commit validates from the pinned generation, so a concurrent first + // append in the read->begin-write window is detected at commit instead of being silently allowed. + Assertions.assertEquals(Long.valueOf(-1L), txn.getBaseSnapshotId(), + "an explicitly empty read must stay an OCC fence across a concurrent first append"); } // ───────────────────────────── MERGE sink (TIcebergMergeSink) ───────────────────────────── diff --git a/fe/fe-core/src/test/java/org/apache/doris/common/PropertyAnalyzerTest.java b/fe/fe-core/src/test/java/org/apache/doris/common/PropertyAnalyzerTest.java index 67aaa87bee9ee2..bb27cd7cf134a9 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/common/PropertyAnalyzerTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/common/PropertyAnalyzerTest.java @@ -409,7 +409,12 @@ public void testAnalyzePartitionInvertedIndexFileStorageFormat() throws Analysis properties.put(PropertyAnalyzer.PROPERTIES_PARTITION_INVERTED_INDEX_STORAGE_FORMAT, "V1"); AnalysisException v1Exception = Assertions.assertThrows(AnalysisException.class, () -> PropertyAnalyzer.analyzePartitionInvertedIndexFileStorageFormat(properties)); - Assertions.assertTrue(v1Exception.getMessage().contains("only supports V2, V3 and SNII")); + // #64522 blocks V1 inside analyzeInvertedIndexFileStorageFormat ("deprecated ... use V2") before + // the partition-level check ("only supports V2, V3 and SNII") can run; either message rejects V1. + Assertions.assertTrue(v1Exception.getMessage().contains("only supports V2, V3 and SNII") + || v1Exception.getMessage().contains( + "Inverted index V1 is deprecated and no longer allowed"), + "V1 must be rejected, got: " + v1Exception.getMessage()); properties.put(PropertyAnalyzer.PROPERTIES_PARTITION_INVERTED_INDEX_STORAGE_FORMAT, "SNII"); Config.enable_partition_inverted_index_storage_format_rollout = false;