mon: test the crush ruleset when creating a pool
We want to fix the following scenario:
* an erasure code plugin (or another part of the code) creates a
ruleset
* the ruleset crashes during mapping (for whatever reason)
* ceph osd pool create uses the bugous ruleset
* the monitors try to do mapping a crash
Having a bugous ruleset in the crush map is very difficult prevent. The
catastrophic event of using it with a newly created pool can however be
prevented by calling the CrushTester just before creating the pool and
after all implicit or explicit crush ruleset creation happened.
http://tracker.ceph.com/issues/11814 Fixes: #11814
Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit
f1e86be589803596e86acc964ac5c5c03b4038d8)
Conflicts:
src/test/mon/osd-crush.sh
removed the run_mon because in hammer it is shared
between all tests
src/mon/OSDMonitor.cc
prepare_new_pool changed stringstream to *ostream
(cherry picked from commit
f47ba4b1a1029a55f8bc4ab393a7fa3712cd4e00)