ceph/ceph — pull request #2754 by dachary (2014-10-20 02:13:48+00:00)
Title: mon: use the pending crush when possible to avoid race

The following is racy:

ceph osd crush rule create-simple ...
ceph osd crush rule ls

because osd crush rule ls does not use the pending crushmap. If the
machine is fast enough the second command will run before paxos has time
to propose and incorrectly claim the rule does not exist.

Set the latest_crush pointer in OSDMonitor::preprocess_command to either
the pending crushmap or the one from osdmap. This involves decoding the
pending crush map but it is not a performance critical function.

http://tracker.ceph.com/issues/9826 Fixes: #9826

Signed-off-by: Loic Dachary