path=self.mount_a.mountpoint,
file_count=LOW_LIMIT
)))
+
+ def test_purge_queue_upgrade(self):
+ """
+ That when starting on a system with no purge queue in the metadata
+ pool, we silently create one.
+ :return:
+ """
+
+ self.mds_cluster.mds_stop()
+ self.mds_cluster.mds_fail()
+ self.fs.rados(["rm", "500.00000000"])
+ self.mds_cluster.mds_restart()
+ self.fs.wait_for_daemons()
\ No newline at end of file
DECODE_FINISH(p);
}
-// TODO: implement purge queue creation on startup
-// if we are on a filesystem created before purge queues existed
// TODO: when we're deactivating, lift all limits on
// how many OSD ops we're allowed to emit at a time to
// race through the queue as fast as we can.
Mutex::Locker l(lock);
journaler.recover(new FunctionContext([this, completion](int r){
- Mutex::Locker l(lock);
- dout(4) << "open complete" << dendl;
- if (r == 0) {
- journaler.set_writeable();
+ if (r == -ENOENT) {
+ dout(1) << "Purge Queue not found, assuming this is an upgrade and "
+ "creating it." << dendl;
+ create(completion);
+ } else {
+ Mutex::Locker l(lock);
+ dout(4) << "open complete" << dendl;
+ if (r == 0) {
+ journaler.set_writeable();
+ }
+ completion->complete(r);
}
- completion->complete(r);
}));
}