Skip to content

Commit f490ece

Browse files
authored
HDDS-13466. Intermittent timeout in TestOmSnapshot (#9471)
1 parent 0740942 commit f490ece

9 files changed

Lines changed: 18 additions & 33 deletions

.github/workflows/intermittent-test-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129
java-version: ${{ github.event.inputs.java-version }}
130130
- name: Build (most) of Ozone
131131
run: |
132-
args="-DskipRecon -DskipShade -Dmaven.javadoc.skip=true"
132+
args="-DskipRecon -DskipShade -Dmaven.javadoc.skip=true -Drocks_tools_native"
133133
if [[ "${{ github.event.inputs.ratis-ref }}" != "" ]]; then
134134
args="$args -Dratis.version=${{ needs.ratis.outputs.ratis-version }}"
135135
args="$args -Dratis.thirdparty.version=${{ needs.ratis.outputs.thirdparty-version }}"
@@ -199,7 +199,7 @@ jobs:
199199
export OZONE_REPO_CACHED=true
200200
fi
201201
202-
args="-DexcludedGroups=native|slow|unhealthy -DskipShade"
202+
args="-DexcludedGroups=native|slow|unhealthy -DskipShade -Drocks_tools_native"
203203
if [[ "${{ github.event.inputs.ratis-ref }}" != "" ]]; then
204204
args="$args -Dratis.version=${{ needs.ratis.outputs.ratis-version }}"
205205
args="$args -Dratis.thirdparty.version=${{ needs.ratis.outputs.thirdparty-version }}"

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import static org.apache.hadoop.ozone.OzoneConsts.OM_KEY_PREFIX;
2929
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_DEFAULT_BUCKET_LAYOUT;
3030
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS;
31+
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_SNAPSHOT_CACHE_CLEANUP_SERVICE_RUN_INTERVAL;
3132
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_SNAPSHOT_DIFF_DISABLE_NATIVE_LIBS;
3233
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_SNAPSHOT_FORCE_FULL_DIFF;
3334
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_SNAPSHOT_SST_FILTERING_SERVICE_INTERVAL;
@@ -127,6 +128,7 @@
127128
import org.apache.hadoop.ozone.client.io.OzoneDataStreamOutput;
128129
import org.apache.hadoop.ozone.client.io.OzoneInputStream;
129130
import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
131+
import org.apache.hadoop.ozone.om.IOmMetadataReader;
130132
import org.apache.hadoop.ozone.om.KeyManagerImpl;
131133
import org.apache.hadoop.ozone.om.OMConfigKeys;
132134
import org.apache.hadoop.ozone.om.OMStorage;
@@ -157,6 +159,7 @@
157159
import org.apache.ozone.rocksdiff.RocksDBCheckpointDiffer;
158160
import org.apache.ozone.test.GenericTestUtils;
159161
import org.apache.ozone.test.tag.Slow;
162+
import org.apache.ratis.util.function.UncheckedAutoCloseableSupplier;
160163
import org.junit.jupiter.api.AfterAll;
161164
import org.junit.jupiter.api.Test;
162165
import org.junit.jupiter.api.TestInstance;
@@ -231,6 +234,7 @@ private void init() throws Exception {
231234
conf.setInt(OMStorage.TESTING_INIT_LAYOUT_VERSION_KEY, OMLayoutFeature.BUCKET_LAYOUT_SUPPORT.layoutVersion());
232235
conf.setTimeDuration(OZONE_SNAPSHOT_DELETING_SERVICE_INTERVAL, 1, TimeUnit.SECONDS);
233236
conf.setInt(OZONE_SNAPSHOT_SST_FILTERING_SERVICE_INTERVAL, -1);
237+
conf.setTimeDuration(OZONE_OM_SNAPSHOT_CACHE_CLEANUP_SERVICE_RUN_INTERVAL, 100, TimeUnit.MILLISECONDS);
234238
if (!disableNativeDiff) {
235239
conf.setTimeDuration(OZONE_OM_SNAPSHOT_COMPACTION_DAG_PRUNE_DAEMON_RUN_INTERVAL, 0, TimeUnit.SECONDS);
236240
}
@@ -2045,10 +2049,10 @@ private void createFileKey(FileSystem fs,
20452049
@Test
20462050
public void testSnapshotOpensWithDisabledAutoCompaction() throws Exception {
20472051
String snapPrefix = createSnapshot(volumeName, bucketName);
2048-
try (RDBStore snapshotDBStore = (RDBStore)
2049-
((OmSnapshot) cluster.getOzoneManager().getOmSnapshotManager()
2050-
.getActiveFsMetadataOrSnapshot(volumeName, bucketName, snapPrefix).get())
2051-
.getMetadataManager().getStore()) {
2052+
try (UncheckedAutoCloseableSupplier<IOmMetadataReader> snapshotSupplier =
2053+
cluster.getOzoneManager().getOmSnapshotManager()
2054+
.getActiveFsMetadataOrSnapshot(volumeName, bucketName, snapPrefix)) {
2055+
RDBStore snapshotDBStore = (RDBStore)((OmSnapshot)snapshotSupplier.get()).getMetadataManager().getStore();
20522056
for (String table : snapshotDBStore.getTableNames().values()) {
20532057
assertTrue(snapshotDBStore.getDb().getColumnFamily(table)
20542058
.getHandle().getDescriptor()
@@ -2173,15 +2177,15 @@ public void testCompactionDagDisableForSnapshotMetadata() throws Exception {
21732177
assertNotNull(activeDbStore.getRocksDBCheckpointDiffer());
21742178
assertEquals(2, activeDbStore.getDbOptions().listeners().size());
21752179

2176-
OmSnapshot omSnapshot = (OmSnapshot) cluster.getOzoneManager()
2180+
try (UncheckedAutoCloseableSupplier<IOmMetadataReader> omSnapshot = cluster.getOzoneManager()
21772181
.getOmSnapshotManager()
2178-
.getActiveFsMetadataOrSnapshot(volumeName, bucketName, snapshotName).get();
2179-
2180-
RDBStore snapshotDbStore =
2181-
(RDBStore) omSnapshot.getMetadataManager().getStore();
2182-
// RocksDBCheckpointDiffer should be null for snapshot DB store.
2183-
assertNull(snapshotDbStore.getRocksDBCheckpointDiffer());
2184-
assertEquals(0, snapshotDbStore.getDbOptions().listeners().size());
2182+
.getActiveFsMetadataOrSnapshot(volumeName, bucketName, snapshotName)) {
2183+
RDBStore snapshotDbStore =
2184+
(RDBStore) ((OmSnapshot)omSnapshot.get()).getMetadataManager().getStore();
2185+
// RocksDBCheckpointDiffer should be null for snapshot DB store.
2186+
assertNull(snapshotDbStore.getRocksDBCheckpointDiffer());
2187+
assertEquals(0, snapshotDbStore.getDbOptions().listeners().size());
2188+
}
21852189
}
21862190

21872191
@Test

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@
2020
import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY;
2121
import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED;
2222

23-
import org.apache.ozone.test.tag.Unhealthy;
2423
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
2524

2625
/**
2726
* Test OmSnapshot for FSO bucket type when native lib is enabled.
2827
*/
2928
@EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true")
30-
@Unhealthy("HDDS-13466")
3129
class TestOmSnapshotFsoWithNativeLib extends TestOmSnapshot {
3230
TestOmSnapshotFsoWithNativeLib() throws Exception {
3331
super(FILE_SYSTEM_OPTIMIZED, false, false, false, false);

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@
2020
import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY;
2121
import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED;
2222

23-
import org.apache.ozone.test.tag.Unhealthy;
2423
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
2524

2625
/**
2726
* Test OmSnapshot for FSO bucket type when native lib is enabled.
2827
*/
2928
@EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true")
30-
@Unhealthy("HDDS-13466")
3129
class TestOmSnapshotFsoWithNativeLibWithLinkedBuckets extends TestOmSnapshot {
3230
TestOmSnapshotFsoWithNativeLibWithLinkedBuckets() throws Exception {
3331
super(FILE_SYSTEM_OPTIMIZED, false, false, false, true);

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919

2020
import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED;
2121

22-
import org.apache.ozone.test.tag.Unhealthy;
23-
2422
/**
2523
* Test OmSnapshot for FSO bucket type when native lib is disabled.
2624
*/
27-
@Unhealthy("HDDS-13466")
2825
public class TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets extends TestOmSnapshot {
2926

3027
public TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets() throws Exception {

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919

2020
import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE;
2121

22-
import org.apache.ozone.test.tag.Unhealthy;
23-
2422
/**
2523
* Test OmSnapshot for Object Store bucket type.
2624
*/
27-
@Unhealthy("HDDS-13466")
2825
public class TestOmSnapshotObjectStore extends TestOmSnapshot {
2926

3027
public TestOmSnapshotObjectStore() throws Exception {

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919

2020
import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE;
2121

22-
import org.apache.ozone.test.tag.Unhealthy;
23-
2422
/**
2523
* Test OmSnapshot for Object Store bucket type.
2624
*/
27-
@Unhealthy("HDDS-13466")
2825
public class TestOmSnapshotObjectStoreWithLinkedBuckets extends TestOmSnapshot {
2926

3027
public TestOmSnapshotObjectStoreWithLinkedBuckets() throws Exception {

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919

2020
import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY;
2121

22-
import org.apache.ozone.test.tag.Unhealthy;
23-
2422
/**
2523
* Test OmSnapshot for Legacy bucket type.
2624
*/
27-
@Unhealthy("HDDS-13466")
2825
public class TestOmSnapshotWithBucketLinkingLegacy extends TestOmSnapshot {
2926

3027
public TestOmSnapshotWithBucketLinkingLegacy() throws Exception {

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919

2020
import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY;
2121

22-
import org.apache.ozone.test.tag.Unhealthy;
23-
2422
/**
2523
* Test OmSnapshot for Legacy bucket type.
2624
*/
27-
@Unhealthy("HDDS-13466")
2825
public class TestOmSnapshotWithoutBucketLinkingLegacy extends TestOmSnapshot {
2926

3027
public TestOmSnapshotWithoutBucketLinkingLegacy() throws Exception {

0 commit comments

Comments
 (0)