code: ServerContext setCommitIndex(long commitIndex) {
      Assert.argNot(commitIndex < 0, "commit index must be positive");
      long previousCommitIndex = this.commitIndex;
      if (commitIndex > previousCommitIndex) {
        this.commitIndex = commitIndex;
        log.commit(Math.min(commitIndex, log.lastIndex()));
        long configurationIndex = cluster.getConfiguration().index();
        if (configurationIndex > previousCommitIndex && configurationIndex <= commitIndex) {
          cluster.commit();
        }
      }
      return this;
    }
docs: Sets the commit index.
  
  @param commitIndex The commit index.
  @return The Raft context.