if (!stateTransferLock.acquireForCommand(ctx, cmd)) {
// TODO If the super call throws a RehashInProgressException, we should release the state transfer lock
// to allow any pending rehash to finish and then retry the operation
// Then we could throw a RehashInProgressException only on remote nodes and include the view id in the
// exception message to make sure we got the right rehash
throw new RehashInProgressException("Timed out waiting for the transaction lock");
}
try {
return super.visitPrepareCommand(ctx, cmd);
} finally {
stateTransferLock.releaseForCommand(ctx, cmd);