File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
src/java/org/apache/cassandra/journal
test/distributed/org/apache/cassandra/distributed/test/tracking Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -845,16 +845,6 @@ public long getDiskSpaceUsed()
845845 totalSize += dataFile .length ();
846846 }
847847 }
848-
849- // Add current active segment
850- ActiveSegment <K , V > active = currentSegment ;
851- if (active != null )
852- {
853- File activeFile = active .descriptor .fileFor (Component .DATA );
854- if (activeFile .exists ())
855- totalSize += activeFile .length ();
856- }
857-
858848 return totalSize ;
859849 }
860850
Original file line number Diff line number Diff line change @@ -149,12 +149,16 @@ public void testBroadcastOffsetsDiscoveredMetric() throws Throwable
149149 cluster .get (1 ).runOnInstance (() -> MutationTrackingService .instance .broadcastOffsetsForTesting ());
150150
151151 // Wait for broadcasts to propagate to node 3
152+ long [] previousCount = {0 };
152153 Awaitility .await ()
153154 .atMost (Duration .ofSeconds (5 ))
154155 .pollInterval (Duration .ofMillis (100 ))
155156 .until (() -> {
156- long node3Delta = cluster .get (3 ).callOnInstance (() -> MutationTrackingMetrics .instance .broadcastOffsetsDiscovered .getCount ()) - initialNode3Count ;
157- return node3Delta > 0 ;
157+ long currentCount = cluster .get (3 ).callOnInstance (() -> MutationTrackingMetrics .instance .broadcastOffsetsDiscovered .getCount ());
158+ boolean hasDiscoveredOffsets = currentCount > initialNode3Count ;
159+ boolean isStable = hasDiscoveredOffsets && currentCount == previousCount [0 ];
160+ previousCount [0 ] = currentCount ;
161+ return isStable ;
158162 });
159163
160164 // Get the count after first broadcast
You can’t perform that action at this time.
0 commit comments