Skip to content

Commit

Permalink
Core, Spark 3.5: Fix test failures due to timeout (#11654)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuzhang authored Dec 17, 2024
1 parent ce7a4b4 commit ed06c9c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*/
package org.apache.iceberg.hadoop;

import static org.apache.iceberg.CatalogProperties.LOCK_ACQUIRE_TIMEOUT_MS;
import static org.apache.iceberg.TableProperties.COMMIT_MAX_RETRY_WAIT_MS;
import static org.apache.iceberg.TableProperties.COMMIT_MIN_RETRY_WAIT_MS;
import static org.apache.iceberg.TableProperties.COMMIT_NUM_RETRIES;
import static org.apache.iceberg.types.Types.NestedField.optional;
import static org.apache.iceberg.types.Types.NestedField.required;
Expand Down Expand Up @@ -421,7 +424,16 @@ public void testConcurrentFastAppends(@TempDir File dir) throws Exception {
TABLES.create(
SCHEMA,
SPEC,
ImmutableMap.of(COMMIT_NUM_RETRIES, String.valueOf(threadsCount)),
ImmutableMap.of(
COMMIT_NUM_RETRIES,
String.valueOf(threadsCount),
COMMIT_MIN_RETRY_WAIT_MS,
"10",
COMMIT_MAX_RETRY_WAIT_MS,
"1000",
// Disable extra retry on lock acquire failure since commit will fail anyway.
LOCK_ACQUIRE_TIMEOUT_MS,
"0"),
dir.toURI().toString());

String fileName = UUID.randomUUID().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import static org.apache.iceberg.RowLevelOperationMode.MERGE_ON_READ;
import static org.apache.iceberg.SnapshotSummary.ADDED_DVS_PROP;
import static org.apache.iceberg.SnapshotSummary.ADD_POS_DELETE_FILES_PROP;
import static org.apache.iceberg.TableProperties.COMMIT_MAX_RETRY_WAIT_MS;
import static org.apache.iceberg.TableProperties.COMMIT_MIN_RETRY_WAIT_MS;
import static org.apache.iceberg.TableProperties.DELETE_DISTRIBUTION_MODE;
import static org.apache.iceberg.TableProperties.DELETE_ISOLATION_LEVEL;
import static org.apache.iceberg.TableProperties.DELETE_MODE;
Expand Down Expand Up @@ -1148,8 +1150,14 @@ public synchronized void testDeleteWithSnapshotIsolation()
createOrReplaceView("deleted_id", Collections.singletonList(1), Encoders.INT());

sql(
"ALTER TABLE %s SET TBLPROPERTIES('%s' '%s')",
tableName, DELETE_ISOLATION_LEVEL, "snapshot");
"ALTER TABLE %s SET TBLPROPERTIES('%s'='%s', '%s'='%s', '%s'='%s')",
tableName,
DELETE_ISOLATION_LEVEL,
"snapshot",
COMMIT_MIN_RETRY_WAIT_MS,
"10",
COMMIT_MAX_RETRY_WAIT_MS,
"1000");

sql("INSERT INTO TABLE %s VALUES (1, 'hr')", tableName);
createBranchIfNeeded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
package org.apache.iceberg.spark.extensions;

import static org.apache.iceberg.RowLevelOperationMode.COPY_ON_WRITE;
import static org.apache.iceberg.TableProperties.COMMIT_MAX_RETRY_WAIT_MS;
import static org.apache.iceberg.TableProperties.COMMIT_MIN_RETRY_WAIT_MS;
import static org.apache.iceberg.TableProperties.MERGE_DISTRIBUTION_MODE;
import static org.apache.iceberg.TableProperties.MERGE_ISOLATION_LEVEL;
import static org.apache.iceberg.TableProperties.MERGE_MODE;
Expand Down Expand Up @@ -1610,8 +1612,14 @@ public synchronized void testMergeWithSnapshotIsolation()
createOrReplaceView("source", Collections.singletonList(1), Encoders.INT());

sql(
"ALTER TABLE %s SET TBLPROPERTIES('%s' '%s')",
tableName, MERGE_ISOLATION_LEVEL, "snapshot");
"ALTER TABLE %s SET TBLPROPERTIES('%s'='%s', '%s'='%s', '%s'='%s')",
tableName,
MERGE_ISOLATION_LEVEL,
"snapshot",
COMMIT_MIN_RETRY_WAIT_MS,
"10",
COMMIT_MAX_RETRY_WAIT_MS,
"1000");

sql("INSERT INTO TABLE %s VALUES (1, 'hr')", tableName);
createBranchIfNeeded();
Expand Down

0 comments on commit ed06c9c

Please sign in to comment.