requeue_ops(waiting_for_active);
+ if (scrubber.queue_snap_trim) {
+ dout(10) << "scrub finished, requeuing snap_trimmer" << dendl;
+ queue_snap_trim();
+ }
+
scrubber.reset();
// type-specific state clear
Scrubber() :
reserved(false), reserve_failed(false),
epoch_start(0),
- block_writes(false), active(false), waiting_on(0),
- errors(0), fixed(0), active_rep_scrub(0),
+ block_writes(false), active(false), queue_snap_trim(false),
+ waiting_on(0), errors(0), fixed(0), active_rep_scrub(0),
finalizing(false), is_chunky(false), state(INACTIVE),
deep(false)
{
// common to both scrubs
bool block_writes;
bool active;
+ bool queue_snap_trim;
int waiting_on;
set<int> waiting_on_whom;
int errors;
finalizing = false;
block_writes = false;
active = false;
+ queue_snap_trim = false;
waiting_on = 0;
waiting_on_whom.clear();
if (active_rep_scrub) {
dout(10) << "snap_trimmer entry" << dendl;
if (is_primary()) {
entity_inst_t nobody;
- if (!mode.try_write(nobody) || scrubber.active) {
- dout(10) << " can't write, requeueing" << dendl;
- queue_snap_trim();
+ assert(mode.try_write(nobody));
+ if (scrubber.active) {
+ dout(10) << " scrubbing, will requeue snap_trimmer after" << dendl;
+ scrubber.queue_snap_trim = true;
unlock();
return;
}