ISPN-2635 and ISPN-2536: Support total order based commit protocol
move the sort to write command util
compile error fix
fix