We need to flush any prior ops to the fs before we can rely on
collection_list to return all the objects we need to delete. If we miss
any, we will crash shortly after this when the rmdir(2) fails with
-ENOTEMPTY (as with #1471).
Signed-off-by: Sage Weil <sage@newdream.net>
int tr = store->queue_transaction(&pg->osr, t);
assert(tr == 0);
}
+
+ // flush all pg operations to the fs, so we can rely on
+ // collection_list below.
+ pg->osr.flush();
int n = 0;
coll_t col_to_trim(pg->info.pgid, snap_to_trim);
to_trim.erase(snap_to_trim);
+ // flush all operations to fs so we can rely on collection_list
+ // below.
+ pg->osr.flush();
+
vector<hobject_t> obs_to_trim;
pg->osd->store->collection_list(col_to_trim, obs_to_trim);
ObjectStore::Transaction *t = new ObjectStore::Transaction;