* Sends a sync request.
*/
private void doSync(final long prevIndex, final CopycatEntry prevEntry, final List<CopycatEntry> entries) {
final long commitIndex = state.commitIndex();
SyncRequest request = new SyncRequest(state.nextCorrelationId(), state.currentTerm(), state.clusterManager().localNode().member().id(), prevIndex, prevEntry != null ? prevEntry.term() : 0, entries, commitIndex);
sendIndex = Math.max(sendIndex + 1, prevIndex + entries.size() + 1);
LOGGER.debug("{} - Sent {} to {}", state.clusterManager().localNode(), request, node);
node.client().sync(request).whenComplete((response, error) -> {