code: public long setCommitIndex(long commitIndex) {
      this.commitIndex = Math.max(this.commitIndex, commitIndex);
      writer.commit(this.commitIndex);
      return this.commitIndex;
    }
docs: Sets the commit index.
  
  @param commitIndex the commit index
  @return the updated commit index