The only remaining caller is sub_op_modify(). If we do have a non-empty
op transaction, we want to do this update, regardless of what we think
last_backfill is (our notion may be not completely in sync with the
primary). In particular, our last_backfill may be the same object but
a different snapid, but the primary disagrees and is pushing an op
transaction through.
Instead, update the collections if we have a non-empty transaction.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit
31e911b63d326bdd06981ec4029ad71b7479ed70)
for (vector<pg_log_entry_t>::iterator i = log_entries.begin();
i != log_entries.end();
++i) {
- // If past backfill line, snap_collections will be updated during push
- if (i->soid > info.last_backfill)
- continue;
if (i->snaps.length() > 0) {
vector<snapid_t> snaps;
bufferlist::iterator p = i->snaps.begin();
}
info.stats = m->pg_stats;
- update_snap_collections(log, rm->localt);
+ if (!rm->opt.empty()) {
+ // If the opt is non-empty, we infer we are before
+ // last_backfill (according to the primary, not our
+ // not-quite-accurate value), and should update the
+ // collections now. Otherwise, we do it later on push.
+ update_snap_collections(log, rm->localt);
+ }
append_log(log, m->pg_trim_to, rm->localt);
rm->tls.push_back(&rm->localt);