From 32b010bb8edd48817ea2ed43a8e9c01e9448a870 Mon Sep 17 00:00:00 2001 From: Kodai Doki <52027276+KodaiD@users.noreply.github.com> Date: Fri, 17 Oct 2025 06:14:18 +0000 Subject: [PATCH 1/2] Empty commit [skip ci] From 58d0d0d267ce4e9f8e0d4b4f07467f32d38403d6 Mon Sep 17 00:00:00 2001 From: Kodai Doki <52027276+KodaiD@users.noreply.github.com> Date: Tue, 14 Oct 2025 15:45:59 +0900 Subject: [PATCH 2/2] Add wait for cache expiry (#3040) --- .../java/com/scalar/db/storage/cassandra/CassandraEnv.java | 4 ++++ .../java/com/scalar/db/storage/cosmos/CosmosEnv.java | 3 +++ .../java/com/scalar/db/storage/dynamo/DynamoEnv.java | 3 +++ .../java/com/scalar/db/storage/jdbc/JdbcEnv.java | 3 +++ ...sCommitNullMetadataIntegrationTestWithMultiStorage.java | 3 +++ ...ensusCommitSpecificIntegrationTestWithMultiStorage.java | 3 +++ .../multistorage/MultiStorageAdminIntegrationTest.java | 3 +++ .../scalar/db/storage/multistorage/MultiStorageEnv.java | 7 +++++++ .../storage/multistorage/MultiStorageIntegrationTest.java | 3 +++ .../MultiStorageSchemaLoaderIntegrationTest.java | 3 +++ 10 files changed, 35 insertions(+) diff --git a/core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraEnv.java b/core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraEnv.java index 2f55b91ec2..f3f164dee1 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraEnv.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraEnv.java @@ -31,6 +31,10 @@ public static Properties getProperties(@SuppressWarnings("unused") String testNa props.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN, "true"); props.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "true"); props.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_ORDERING, "false"); + + // Metadata cache expiration time + props.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + return props; } diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosEnv.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosEnv.java index fe819039f3..c4b1cd995c 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosEnv.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosEnv.java @@ -32,6 +32,9 @@ public static Properties getProperties(String testName) { CosmosConfig.TABLE_METADATA_DATABASE, DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME + "_" + testName); + // Metadata cache expiration time + props.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + return props; } diff --git a/core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoEnv.java b/core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoEnv.java index d7df4fb67f..2602e22761 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoEnv.java +++ b/core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoEnv.java @@ -52,6 +52,9 @@ public static Properties getProperties(String testName) { DynamoConfig.TABLE_METADATA_NAMESPACE, DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME + "_" + testName); + // Metadata cache expiration time + properties.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + return properties; } diff --git a/core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcEnv.java b/core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcEnv.java index 9e48239307..bc232804a0 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcEnv.java +++ b/core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcEnv.java @@ -37,6 +37,9 @@ public static Properties getProperties(String testName) { JdbcConfig.TABLE_METADATA_SCHEMA, DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME + "_" + testName); + // Metadata cache expiration time + props.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + return props; } diff --git a/core/src/integration-test/java/com/scalar/db/storage/multistorage/ConsensusCommitNullMetadataIntegrationTestWithMultiStorage.java b/core/src/integration-test/java/com/scalar/db/storage/multistorage/ConsensusCommitNullMetadataIntegrationTestWithMultiStorage.java index 99ae15494d..75613651ab 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/multistorage/ConsensusCommitNullMetadataIntegrationTestWithMultiStorage.java +++ b/core/src/integration-test/java/com/scalar/db/storage/multistorage/ConsensusCommitNullMetadataIntegrationTestWithMultiStorage.java @@ -49,6 +49,9 @@ protected Properties getProperties(String testName) { // The default storage is cassandra props.setProperty(MultiStorageConfig.DEFAULT_STORAGE, "cassandra"); + // Metadata cache expiration time + props.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + return ConsensusCommitTestUtils.loadConsensusCommitProperties(props); } } diff --git a/core/src/integration-test/java/com/scalar/db/storage/multistorage/ConsensusCommitSpecificIntegrationTestWithMultiStorage.java b/core/src/integration-test/java/com/scalar/db/storage/multistorage/ConsensusCommitSpecificIntegrationTestWithMultiStorage.java index 9c1e703a98..85d0e0f575 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/multistorage/ConsensusCommitSpecificIntegrationTestWithMultiStorage.java +++ b/core/src/integration-test/java/com/scalar/db/storage/multistorage/ConsensusCommitSpecificIntegrationTestWithMultiStorage.java @@ -49,6 +49,9 @@ protected Properties getProperties(String testName) { // The default storage is cassandra props.setProperty(MultiStorageConfig.DEFAULT_STORAGE, "cassandra"); + // Metadata cache expiration time + props.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + return ConsensusCommitTestUtils.loadConsensusCommitProperties(props); } } diff --git a/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageAdminIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageAdminIntegrationTest.java index b97c6868e6..21bfd954b4 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageAdminIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageAdminIntegrationTest.java @@ -136,6 +136,9 @@ private void initMultiStorageAdmin() { // The default storage is cassandra props.setProperty(MultiStorageConfig.DEFAULT_STORAGE, "cassandra"); + // Metadata cache expiration time + props.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + multiStorageAdmin = new MultiStorageAdmin(new DatabaseConfig(props)); } diff --git a/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageEnv.java b/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageEnv.java index 5bcdc9eed0..5bb8ea4e27 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageEnv.java +++ b/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageEnv.java @@ -43,6 +43,10 @@ public static Properties getPropertiesForCassandra(@SuppressWarnings("unused") S properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN, "true"); properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "false"); properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_ORDERING, "false"); + + // Metadata cache expiration time + properties.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + return properties; } @@ -65,6 +69,9 @@ public static Properties getPropertiesForJdbc(String testName) { JdbcConfig.TABLE_METADATA_SCHEMA, DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME + "_" + testName); + // Metadata cache expiration time + properties.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + return properties; } } diff --git a/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageIntegrationTest.java index 1ef778e9b5..c4933aae4a 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageIntegrationTest.java @@ -131,6 +131,9 @@ private void initMultiStorage() { // The default storage is cassandra props.setProperty(MultiStorageConfig.DEFAULT_STORAGE, "cassandra"); + // Metadata cache expiration time + props.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + multiStorage = new MultiStorage(new DatabaseConfig(props)); } diff --git a/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageSchemaLoaderIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageSchemaLoaderIntegrationTest.java index f205ad6983..e2a30bc439 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageSchemaLoaderIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/multistorage/MultiStorageSchemaLoaderIntegrationTest.java @@ -47,6 +47,9 @@ protected Properties getProperties(String testName) { // The default storage is cassandra props.setProperty(MultiStorageConfig.DEFAULT_STORAGE, "cassandra"); + // Metadata cache expiration time + props.setProperty(DatabaseConfig.METADATA_CACHE_EXPIRATION_TIME_SECS, "1"); + return props; }