A commit operation can only be performed when the rekey state is prepare or commit_failed.
A cancel operation can only be performed when the rekey state is prepare_complete, prepare_failed or cancel_failed.