docs: public int tryAcquireReplicaSyncPermits(int requestedPermits) {
          assert requestedPermits > 0 : "Invalid permits: " + requestedPermits;
  
          int permits = requestedPermits;
          while (permits > 0 && !replicaSyncSemaphore.tryAcquire(permits)) {
              permits--;
          }
  
          if (permits > 0 && logger.isFinestEnabled()) {
              logger.finest("Acquired " + permits + " replica sync permits, requested permits was " + requestedPermits
                      + ". Remaining permits: " + replicaSyncSemaphore.availablePermits());
          }
          return permits;
      }