Bump the correct metric when doing progress barrier retries

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-20016
This commit is contained in:
Marcus Eriksson 2024-10-01 15:29:06 +02:00
parent 6e0a99c0f5
commit 73d8ee1a71
3 changed files with 4 additions and 12 deletions

View File

@ -529,16 +529,6 @@ public enum CassandraRelevantProperties
// but it makes sense to group logically related properties together
TCM_ALLOW_TRANSFORMATIONS_DURING_UPGRADES("cassandra.allow_transformations_during_upgrades", "false"),
/**
* for obtaining acknowlegement from peers to make progress in multi-step operations
*/
TCM_PROGRESS_BARRIER_BACKOFF_MILLIS("cassandra.progress_barrier_backoff_ms", "1000"),
TCM_PROGRESS_BARRIER_TIMEOUT_MILLIS("cassandra.progress_barrier_timeout_ms", "3600000"),
/**
* size of in-memory index of max epoch -> sealed period
*/
TCM_RECENTLY_SEALED_PERIOD_INDEX_SIZE("cassandra.recently_sealed_period_index_size", "10"),
/**
* for testing purposes disable the automatic CMS reconfiguration after a bootstrap/replace/move operation
*/

View File

@ -198,7 +198,7 @@ public class ProgressBarrier
Retry.Deadline deadline = Retry.Deadline.after(TimeUnit.MILLISECONDS.toNanos(TIMEOUT_MILLIS),
new Retry.Backoff(DatabaseDescriptor.getCmsDefaultRetryMaxTries(),
(int) BACKOFF_MILLIS,
TCMMetrics.instance.fetchLogRetries));
TCMMetrics.instance.progressBarrierRetries));
while (!deadline.reachedMax())
{
for (WatermarkRequest request : requests)
@ -523,7 +523,6 @@ public class ProgressBarrier
public WatermarkRequest(InetAddressAndPort to, MessageDelivery messagingService, Epoch waitFor)
{
this.to = to;
this.messagingService = messagingService;
this.waitFor = waitFor;

View File

@ -45,6 +45,7 @@ import org.apache.cassandra.harry.gen.rng.PcgRSUFast;
import org.apache.cassandra.harry.gen.rng.RngUtils;
import org.apache.cassandra.harry.sut.TokenPlacementModel;
import org.apache.cassandra.locator.InetAddressAndPort;
import org.apache.cassandra.metrics.TCMMetrics;
import org.apache.cassandra.net.ConnectionType;
import org.apache.cassandra.net.Message;
import org.apache.cassandra.net.MessageDelivery;
@ -320,7 +321,9 @@ public class ProgressBarrierTest extends CMSTestBase
.advance(metadata.epoch)
.barrier()
.withMessagingService(delivery);
long before = TCMMetrics.instance.progressBarrierRetries.getCount();
progressBarrier.await();
Assert.assertTrue(TCMMetrics.instance.progressBarrierRetries.getCount() - before > 0);
Assert.assertTrue(responded.size() == 1);
}
}