docs: private void compactLogs(long compactIndex) {
      raft.getThreadContext().execute(() -> {
        logger.debug("Compacting logs up to index {}", compactIndex);
        try {
          raft.getLog().compact(compactIndex);
        } catch (Exception e) {
          logger.error("An exception occurred during log compaction: {}", e);
        } finally {
          this.compactFuture.complete(null);
          this.compactFuture = null;
          // Immediately attempt to take new snapshots since compaction is already run after a time interval.
          takeSnapshots(false, false);
        }
      });
    }