When we get the first prep, we may respond to the master with an expanded
list of witnesses for the rename before making any change (or rollback
plan). If the master fails before sending the second prep attempt, we
may end up in the abort path of _commit_slave_rename() with an empty
rollback_bl. That's fine; don't crash. We still need to unfreeze the
srci, but can skip the do_rename_rollback since we didn't actually journal
a change.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
}
// abort
- do_rename_rollback(mdr->more()->rollback_bl, mdr->slave_to_mds, mdr);
+ // rollback_bl may be empty if we froze the inode but had to provide an expanded
+ // witness list from the master, and they failed before we tried prep again.
+ if (mdr->more()->rollback_bl.length())
+ do_rename_rollback(mdr->more()->rollback_bl, mdr->slave_to_mds, mdr);
+ else
+ dout(10) << " rollback_bl empty, not rollback back rename (master failed after getting extra witnesses?)" << dendl;
}
}