self.ceph_manager.raw_cluster_cmd('osd', 'primary-affinity',
str(osd), str(1))
- def do_join(self):
+ def stop(self):
"""
- Break out of this Ceph loop
+ Stop the thrasher
"""
self.stopping = True
+
+ def join(self):
+ """
+ Break out of this Ceph loop
+ """
self.thread.get()
if self.sighup_delay:
self.log("joining the do_sighup greenlet")
self.log("joining the do_noscrub_toggle greenlet")
self.noscrub_toggle_thread.join()
+ def stop_and_join(self):
+ """
+ Stop and join the thrasher
+ """
+ self.stop()
+ return self.join()
+
def grow_pool(self):
"""
Increase the size of the pool
"""
self.logger.info(x)
- def do_join(self):
+ def stop(self):
+ """
+ Stop the thrashing process.
+ """
+ self.stopping = True
+
+ def join(self):
"""
Break out of this processes thrashing loop.
"""
self.stopping.set()
self.thread.get()
+ def stop_and_join(self):
+ """
+ Stop the thrashing process and join the thread.
+ """
+ self.stop()
+ return self.join()
+
def should_thrash_store(self):
"""
If allowed, indicate that we should thrash a certain percentage of
yield
finally:
log.info('joining mon_thrasher')
- thrash_proc.do_join()
+ thrash_proc.stop_and_join()
mons = _get_mons(ctx)
manager.wait_for_mon_quorum_size(len(mons))
yield
finally:
log.info('joining scrub')
- scrub_proc.do_join()
+ scrub_proc.stop_and_join()
class Scrubber:
"""
self.thread = gevent.spawn(self.do_scrub)
- def do_join(self):
- """Scrubbing thread finished"""
+ def stop(self):
+ """Stop scrubbing"""
self.stopping = True
+
+ def join(self):
+ """Scrubbing thread finished"""
self.thread.get()
+ def stop_and_join(self):
+ """Stop scrubbing thread"""
+ self.stop()
+ return self.join()
+
def do_scrub(self):
"""Perform the scrub operation"""
frequency = self.config.get("frequency", 30)
def set_thrasher_exception(self, e):
self._exception = e
+ def stop(self):
+ raise NotImplementedError("Subclasses didn't implement this method.")
+
class ThrasherGreenlet(Thrasher, Greenlet):
class Stopped(Exception): ...
if self.is_stopped and raise_stopped:
raise self.Stopped()
return not self.is_stopped
+
+ def stop_and_join(self):
+ self.stop()
+ return self.join()
yield
finally:
log.info('joining thrashosds')
- thrash_proc.do_join()
+ thrash_proc.stop_and_join()
cluster_manager.wait_for_all_osds_up()
cluster_manager.flush_all_pg_stats()
cluster_manager.wait_for_recovery(config.get('timeout', 360))