diff --git a/pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java b/pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java index 8311b5de87c2..aaa054cfded8 100644 --- a/pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java +++ b/pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java @@ -84,7 +84,7 @@ public class PinotBrokerDebug { // Request ID is passed to the RoutingManager to rotate the selected replica-group. - private final AtomicLong _requestIdGenerator = new AtomicLong(); + private final static AtomicLong REQUEST_ID_GENERATOR = new AtomicLong(); @Inject private BrokerRoutingManager _routingManager; @@ -272,7 +272,10 @@ public String getServerRoutingStats() { } private long getRequestId() { - return _requestIdGenerator.getAndIncrement(); + if (REQUEST_ID_GENERATOR.get() == Long.MAX_VALUE) { + REQUEST_ID_GENERATOR.set(0); + } + return REQUEST_ID_GENERATOR.getAndIncrement(); } @GET