mirror of
https://github.com/ceph/ceph
synced 2025-02-22 10:37:15 +00:00
osd/ReplicatedPG: construct appropriate snapc for flush/writeback
Construct a snap context that will trigger the appropriate cloning (if any) on the base pool. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
5b8d957b9c
commit
b2f752a9e1
@ -5331,7 +5331,22 @@ int ReplicatedPG::start_flush(OpContext *ctx, bool blocking)
|
||||
C_Flush *fin = new C_Flush(this, soid, get_last_peering_reset());
|
||||
object_locator_t base_oloc(soid);
|
||||
base_oloc.pool = pool.info.tier_of;
|
||||
SnapContext snapc; // FIXME
|
||||
|
||||
// construct a SnapContext appropriate for this clone/head
|
||||
SnapContext snapc;
|
||||
if (soid.snap == CEPH_NOSNAP) {
|
||||
snapc.seq = snapset.seq;
|
||||
snapc.snaps = snapset.snaps;
|
||||
} else {
|
||||
// we want to only include snaps that are older than the oldest
|
||||
// snap for which we are defined, so that the object appears to
|
||||
// have been written before that.
|
||||
vector<snapid_t>::iterator p = snapset.snaps.begin();
|
||||
while (p != snapset.snaps.end() && *p >= oi.snaps.back())
|
||||
p++;
|
||||
snapc.snaps = vector<snapid_t>(p, snapset.snaps.end());
|
||||
snapc.seq = oi.snaps.back() - 1;
|
||||
}
|
||||
|
||||
osd->objecter_lock.Lock();
|
||||
tid_t tid = osd->objecter->mutate(soid.oid, base_oloc, o, snapc, oi.mtime,
|
||||
|
Loading…
Reference in New Issue
Block a user