public synchronized void free() {
    long size = 0;
    for (Batch pendingBatch : pendingBatches) {
      size += pendingBatch.getSerializedSize();
    }
    pendingBatches.clear();
    controller.update(0L, true);
    iotConsensusMemoryManager.free(size, false);
  }
We only set a flag if this batch is not the first one. Notice, We need to confirm that the
batch in the parameter is actually in pendingBatches, rather than a reference to a different
object with equal data, so we do not inherit method equals for Batch
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/SyncStatus.java