From 4f30e677857fbe26b86aacf33c1b0f35fe65f555 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 3 Nov 2017 15:52:13 -0500 Subject: [PATCH] osd/PrimaryLogPG: do not pull-up snapc to snapset make_writeable() had some logic to pull old request snapcs forward to what was in the SnapSet. This has no effect: if we pull forward, the main block of make_writeable does not trigger, because no clone is generated when snapc =~ snapset. Signed-off-by: Sage Weil --- src/osd/PrimaryLogPG.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 12378b50d27..27f6e9acf20 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -7062,12 +7062,8 @@ void PrimaryLogPG::make_writeable(OpContext *ctx) --ctx->delta_stats.num_objects_omap; } - // use newer snapc? if (ctx->new_snapset.seq > snapc.seq) { - snapc.seq = ctx->new_snapset.seq; - snapc.snaps = ctx->new_snapset.snaps; - filter_snapc(snapc.snaps); - dout(10) << " using newer snapc " << snapc << dendl; + dout(10) << " op snapset is old" << dendl; } if ((ctx->obs->exists && !ctx->obs->oi.is_whiteout()) && // head exist(ed) @@ -7167,9 +7163,11 @@ void PrimaryLogPG::make_writeable(OpContext *ctx) } } - // update snapset with latest snap context - ctx->new_snapset.seq = snapc.seq; - ctx->new_snapset.snaps = snapc.snaps; + if (snapc.seq > ctx->new_snapset.seq) { + // update snapset with latest snap context + ctx->new_snapset.seq = snapc.seq; + ctx->new_snapset.snaps = snapc.snaps; + } dout(20) << "make_writeable " << soid << " done, snapset=" << ctx->new_snapset << dendl; } -- 2.39.5