This is an automated email from the ASF dual-hosted git repository.

DomGarguilo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new f34eb1e32c fixes CompactionPriorityQueueMetricsIT (#6687)
f34eb1e32c is described below

commit f34eb1e32c5a0f36cca352b88bd9d55e60dc9dd0
Author: Dom G. <[email protected]>
AuthorDate: Thu Dec 3 11:07:59 2026 -0500

    fixes CompactionPriorityQueueMetricsIT (#6687)
---
 .../CompactionPriorityQueueMetricsIT.java          | 59 +++++++++++-----------
 1 file changed, 29 insertions(+), 30 deletions(-)

diff --git 
a/test/src/main/java/org/apache/accumulo/test/compaction/CompactionPriorityQueueMetricsIT.java
 
b/test/src/main/java/org/apache/accumulo/test/compaction/CompactionPriorityQueueMetricsIT.java
index c8df5040c3..48544ff5df 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/compaction/CompactionPriorityQueueMetricsIT.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/compaction/CompactionPriorityQueueMetricsIT.java
@@ -341,7 +341,23 @@ public class CompactionPriorityQueueMetricsIT extends 
SharedMiniClusterBase {
     boolean sawMetricsQ1 = false;
     boolean sawMetricsQ1Size = false;
 
-    while (!sawMetricsQ1 || !sawMetricsQ1Size) {
+    // Set lowest priority to the lowest possible system compaction priority
+    long lowestPriority = Short.MIN_VALUE;
+    long rejectedCount = 0L;
+
+    boolean sawQueues = false;
+
+    // Priority is the file counts + number of compactions for that tablet.
+    // The lowestPriority job in the queue should have been
+    // at least 1 count higher than the highest file count.
+    TableId tid = context.getTableId(tableName);
+    short highestFileCountPrio =
+        
CompactionJobPrioritizer.createPriority(getCluster().getServerContext().getNamespaceId(tid),
+            tid, CompactionKind.USER, (int) highestFileCount, 0,
+            
context.getTableConfiguration(tid).getCount(Property.TABLE_FILE_MAX));
+
+    while (!sawMetricsQ1 || !sawMetricsQ1Size || rejectedCount == 0 || 
!sawQueues
+        || lowestPriority <= highestFileCountPrio) {
       while (!queueMetrics.isEmpty()) {
         var qm = queueMetrics.take();
         if 
(qm.getName().contains(COMPACTOR_JOB_PRIORITY_QUEUE_JOBS_QUEUED.getName())
@@ -356,44 +372,27 @@ public class CompactionPriorityQueueMetricsIT extends 
SharedMiniClusterBase {
             sawMetricsQ1Size = true;
           }
         }
+        if 
(qm.getName().contains(COMPACTOR_JOB_PRIORITY_QUEUE_JOBS_REJECTED.getName())
+            && qm.getTags().containsValue(QUEUE1_METRIC_LABEL)) {
+          // micrometer FunctionCounter, statsd only sends per-poll deltas, so 
sum
+          rejectedCount += Long.parseLong(qm.getValue());
+        } else if 
(qm.getName().contains(COMPACTOR_JOB_PRIORITY_QUEUE_JOBS_PRIORITY.getName())
+            && qm.getTags().containsValue(QUEUE1_METRIC_LABEL)) {
+          lowestPriority = Math.max(lowestPriority, 
Long.parseLong(qm.getValue()));
+        } else if 
(qm.getName().contains(COMPACTOR_JOB_PRIORITY_QUEUES.getName())) {
+          sawQueues = true;
+        } else {
+          log.debug("{}", qm);
+        }
       }
 
       // If metrics are not found in the queue, sleep until the next poll.
       
UtilWaitThread.sleep(TestStatsDRegistryFactory.pollingFrequency.toMillis());
     }
 
-    // Set lowest priority to the lowest possible system compaction priority
-    long lowestPriority = Short.MIN_VALUE;
-    long rejectedCount = 0L;
-
-    boolean sawQueues = false;
-    // An empty queue means that the last known value is the most recent.
-    while (!queueMetrics.isEmpty()) {
-      var metric = queueMetrics.take();
-      if 
(metric.getName().contains(COMPACTOR_JOB_PRIORITY_QUEUE_JOBS_REJECTED.getName())
-          && metric.getTags().containsValue(QUEUE1_METRIC_LABEL)) {
-        rejectedCount = Long.parseLong(metric.getValue());
-      } else if 
(metric.getName().contains(COMPACTOR_JOB_PRIORITY_QUEUE_JOBS_PRIORITY.getName())
-          && metric.getTags().containsValue(QUEUE1_METRIC_LABEL)) {
-        lowestPriority = Math.max(lowestPriority, 
Long.parseLong(metric.getValue()));
-      } else if 
(metric.getName().contains(COMPACTOR_JOB_PRIORITY_QUEUES.getName())) {
-        sawQueues = true;
-      } else {
-        log.debug("{}", metric);
-      }
-    }
-
     // Confirm metrics were generated and in some cases, validate contents.
     assertTrue(rejectedCount > 0L);
 
-    // Priority is the file counts + number of compactions for that tablet.
-    // The lowestPriority job in the queue should have been
-    // at least 1 count higher than the highest file count.
-    TableId tid = context.getTableId(tableName);
-    short highestFileCountPrio =
-        
CompactionJobPrioritizer.createPriority(getCluster().getServerContext().getNamespaceId(tid),
-            tid, CompactionKind.USER, (int) highestFileCount, 0,
-            
context.getTableConfiguration(tid).getCount(Property.TABLE_FILE_MAX));
     assertTrue(lowestPriority > highestFileCountPrio,
         lowestPriority + " " + highestFileCount + " " + highestFileCountPrio);
 

Reply via email to