public synchronized void addNextBatch(Batch batch) throws InterruptedException {
    while (pendingBatches.size() >= config.getReplication().getMaxPendingBatchesNum()
        || !iotConsensusMemoryManager.reserve(batch.getSerializedSize(), false)) {
      wait();
    }
    pendingBatches.add(batch);
  }
we may block here if the synchronization pipeline is full.

@throws InterruptedException
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/SyncStatus.java