You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "keith-turner (via GitHub)" <gi...@apache.org> on 2026/04/03 16:43:10 UTC

[PR] reduces flaking in ClassLoaderContextCompactionIT [accumulo]

keith-turner opened a new pull request, #6294:
URL: https://github.com/apache/accumulo/pull/6294

   There were two sources of flakiness in this test.  One was that table properties would not always propagate to compactors before compactions ran.  Another was that the first table compaction initiated could spawn multiple compactions, like after one failed it would spawn another. This caused metrics to jump ahead of what the test was looking for.  The test sill flakes sometimes because it may not always see the metrics its looking for, but it flakes less frequently w/ these changes.


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] reduces flaking in ClassLoaderContextCompactionIT [accumulo]

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #6294:
URL: https://github.com/apache/accumulo/pull/6294#discussion_r3033598897


##########
test/src/main/java/org/apache/accumulo/test/compaction/ClassLoaderContextCompactionIT.java:
##########
@@ -228,28 +235,9 @@ public void testClassLoaderContextErrorKillsCompactor() throws Exception {
       assertEquals(0, terminations.get());
       assertEquals(0, consecutive.get());
 
-      // Start a compaction. The missing jar should cause a failure
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
-      Wait.waitFor(
-          () -> ExternalCompactionUtil.getRunningCompaction(compactorAddr, (ClientContext) client)
-              == null);
-      assertEquals(1, ExternalCompactionUtil.countCompactors(ResourceGroupId.of(GROUP1),
-          (ClientContext) client));
-      Wait.waitFor(() -> failures.get() == 1);
-      Wait.waitFor(() -> consecutive.get() == 1);
-
-      Wait.waitFor(() -> failures.get() == 0);
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
-      Wait.waitFor(
-          () -> ExternalCompactionUtil.getRunningCompaction(compactorAddr, (ClientContext) client)
-              == null);
-      assertEquals(1, ExternalCompactionUtil.countCompactors(ResourceGroupId.of(GROUP1),
-          (ClientContext) client));
-      Wait.waitFor(() -> failures.get() == 1);
-      Wait.waitFor(() -> consecutive.get() == 2);
-
-      Wait.waitFor(() -> failures.get() == 0);
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
+      // Start a compaction. The missing jar should cause a failure. As compaction jobs fail this
+      // table operation will keep causing new ones to run.
+      client.tableOperations().compact(clone, new CompactionConfig().setWait(false));

Review Comment:
   I'm thinking we could at least leave in the check for consecutive failures to meet some minimum value (2).



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] reduces flaking in ClassLoaderContextCompactionIT [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #6294:
URL: https://github.com/apache/accumulo/pull/6294#discussion_r3034063640


##########
test/src/main/java/org/apache/accumulo/test/compaction/ClassLoaderContextCompactionIT.java:
##########
@@ -228,28 +235,9 @@ public void testClassLoaderContextErrorKillsCompactor() throws Exception {
       assertEquals(0, terminations.get());
       assertEquals(0, consecutive.get());
 
-      // Start a compaction. The missing jar should cause a failure
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
-      Wait.waitFor(
-          () -> ExternalCompactionUtil.getRunningCompaction(compactorAddr, (ClientContext) client)
-              == null);
-      assertEquals(1, ExternalCompactionUtil.countCompactors(ResourceGroupId.of(GROUP1),
-          (ClientContext) client));
-      Wait.waitFor(() -> failures.get() == 1);
-      Wait.waitFor(() -> consecutive.get() == 1);
-
-      Wait.waitFor(() -> failures.get() == 0);
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
-      Wait.waitFor(
-          () -> ExternalCompactionUtil.getRunningCompaction(compactorAddr, (ClientContext) client)
-              == null);
-      assertEquals(1, ExternalCompactionUtil.countCompactors(ResourceGroupId.of(GROUP1),
-          (ClientContext) client));
-      Wait.waitFor(() -> failures.get() == 1);
-      Wait.waitFor(() -> consecutive.get() == 2);
-
-      Wait.waitFor(() -> failures.get() == 0);
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
+      // Start a compaction. The missing jar should cause a failure. As compaction jobs fail this
+      // table operation will keep causing new ones to run.
+      client.tableOperations().compact(clone, new CompactionConfig().setWait(false));

Review Comment:
   Looking for exactly 3 seems good because we should normally see that based on the way the test configures things to terminate at 3 consecutive failures. If the test flakes out sometimes because it did not see 3 thats probably ok.  Would not want to the test to consistently see something like 2 or 4 and always pass.  We can revisit the test if it continues to be flaky.  These changes make it flake much less frequently when running a 4 or 5 times locally in a row.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] reduces flaking in ClassLoaderContextCompactionIT [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner merged PR #6294:
URL: https://github.com/apache/accumulo/pull/6294


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] reduces flaking in ClassLoaderContextCompactionIT [accumulo]

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #6294:
URL: https://github.com/apache/accumulo/pull/6294#discussion_r3033947665


##########
test/src/main/java/org/apache/accumulo/test/compaction/ClassLoaderContextCompactionIT.java:
##########
@@ -228,28 +235,9 @@ public void testClassLoaderContextErrorKillsCompactor() throws Exception {
       assertEquals(0, terminations.get());
       assertEquals(0, consecutive.get());
 
-      // Start a compaction. The missing jar should cause a failure
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
-      Wait.waitFor(
-          () -> ExternalCompactionUtil.getRunningCompaction(compactorAddr, (ClientContext) client)
-              == null);
-      assertEquals(1, ExternalCompactionUtil.countCompactors(ResourceGroupId.of(GROUP1),
-          (ClientContext) client));
-      Wait.waitFor(() -> failures.get() == 1);
-      Wait.waitFor(() -> consecutive.get() == 1);
-
-      Wait.waitFor(() -> failures.get() == 0);
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
-      Wait.waitFor(
-          () -> ExternalCompactionUtil.getRunningCompaction(compactorAddr, (ClientContext) client)
-              == null);
-      assertEquals(1, ExternalCompactionUtil.countCompactors(ResourceGroupId.of(GROUP1),
-          (ClientContext) client));
-      Wait.waitFor(() -> failures.get() == 1);
-      Wait.waitFor(() -> consecutive.get() == 2);
-
-      Wait.waitFor(() -> failures.get() == 0);
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
+      // Start a compaction. The missing jar should cause a failure. As compaction jobs fail this
+      // table operation will keep causing new ones to run.
+      client.tableOperations().compact(clone, new CompactionConfig().setWait(false));

Review Comment:
   Yes, that's what I was thinking. Or if the metrics are getting ahead of the expected, maybe:
   
   ```
   Wait.waitFor(() -> consecutive.get() > 2);
   ```



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] reduces flaking in ClassLoaderContextCompactionIT [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #6294:
URL: https://github.com/apache/accumulo/pull/6294#discussion_r3033825271


##########
test/src/main/java/org/apache/accumulo/test/compaction/ClassLoaderContextCompactionIT.java:
##########
@@ -228,28 +235,9 @@ public void testClassLoaderContextErrorKillsCompactor() throws Exception {
       assertEquals(0, terminations.get());
       assertEquals(0, consecutive.get());
 
-      // Start a compaction. The missing jar should cause a failure
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
-      Wait.waitFor(
-          () -> ExternalCompactionUtil.getRunningCompaction(compactorAddr, (ClientContext) client)
-              == null);
-      assertEquals(1, ExternalCompactionUtil.countCompactors(ResourceGroupId.of(GROUP1),
-          (ClientContext) client));
-      Wait.waitFor(() -> failures.get() == 1);
-      Wait.waitFor(() -> consecutive.get() == 1);
-
-      Wait.waitFor(() -> failures.get() == 0);
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
-      Wait.waitFor(
-          () -> ExternalCompactionUtil.getRunningCompaction(compactorAddr, (ClientContext) client)
-              == null);
-      assertEquals(1, ExternalCompactionUtil.countCompactors(ResourceGroupId.of(GROUP1),
-          (ClientContext) client));
-      Wait.waitFor(() -> failures.get() == 1);
-      Wait.waitFor(() -> consecutive.get() == 2);
-
-      Wait.waitFor(() -> failures.get() == 0);
-      client.tableOperations().compact(table1, new CompactionConfig().setWait(false));
+      // Start a compaction. The missing jar should cause a failure. As compaction jobs fail this
+      // table operation will keep causing new ones to run.
+      client.tableOperations().compact(clone, new CompactionConfig().setWait(false));

Review Comment:
   Its not in the diff, but there is existing code in the test later on that does the following check.
   
   ```
   Wait.waitFor(() -> consecutive.get() == 3);
   ```
   
   Is that along the lines of what you wanted?



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org