From a627f24345e27a934c965121f4ef75f1b55cb348 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Jul 2017 14:21:33 -0400 Subject: [PATCH] osd: populate last_epoch_split during build_initial_pg_history If we get a pg create and have to generate the pg_history_t fields, populate the last_epoch_split field too. This is needed discard ops sent from before the last split. Specifically, PG::can_discard_op() looks at it when the client has the RESEND_ON_SPLIT feature bit. If we don't discard, we may run afoul of assertions later (e.g., that the object belongs to the PG at all) or potentially process an op out of order. Fixes: http://tracker.ceph.com/issues/20754 Signed-off-by: Sage Weil --- src/osd/OSD.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a5b7659af6f..f3044c05588 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4401,6 +4401,11 @@ void OSD::build_initial_pg_history( if (acting_primary != new_acting_primary) { h->same_primary_since = e; } + if (pgid.pgid.is_split(lastmap->get_pg_num(pgid.pgid.pool()), + osdmap->get_pg_num(pgid.pgid.pool()), + nullptr)) { + h->last_epoch_split = e; + } lastmap = osdmap; } dout(20) << __func__ << " " << debug.str() << dendl; -- 2.47.3