From: Alex Ainscow Date: Tue, 11 Mar 2025 11:00:01 +0000 (+0000) Subject: osd: Create a new interval when the optimization flag gets switch on. X-Git-Tag: v20.3.0~179^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=175e684528755543baa4799489f5c866ea1cb97c;p=ceph.git osd: Create a new interval when the optimization flag gets switch on. This allows for the old EC code to cleanly shutdown using the on_change notification. The new code can then start up cleanly. Signed-off-by: Alex Ainscow --- diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 0e9d9e7e78e73..0ddae3f1492bf 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -4199,6 +4199,8 @@ bool PastIntervals::is_new_interval( uint32_t new_crush_barrier, int32_t old_crush_member, int32_t new_crush_member, + bool old_allow_ec_optimizations, + bool new_allow_ec_optimizations, pg_t pgid) { return old_acting_primary != new_acting_primary || new_acting != old_acting || @@ -4222,7 +4224,8 @@ bool PastIntervals::is_new_interval( old_crush_count != new_crush_count || old_crush_target != new_crush_target || old_crush_barrier != new_crush_barrier || - old_crush_member != new_crush_member; + old_crush_member != new_crush_member || + old_allow_ec_optimizations != new_allow_ec_optimizations; } bool PastIntervals::is_new_interval( @@ -4271,6 +4274,7 @@ bool PastIntervals::is_new_interval( plast->peering_crush_bucket_target, pi->peering_crush_bucket_target, plast->peering_crush_bucket_barrier, pi->peering_crush_bucket_barrier, plast->peering_crush_mandatory_member, pi->peering_crush_mandatory_member, + plast->allows_ecoptimizations(), pi->allows_ecoptimizations(), pgid); } diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index e30f160b7cb53..ea0c3c1dda6f5 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -3461,6 +3461,8 @@ public: uint32_t new_crush_barrier, int32_t old_crush_member, int32_t new_crush_member, + bool old_allow_ec_optimizations, + bool new_allow_ec_optimizations, pg_t pgid ); diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index ad371fefb2dde..837953f39ae04 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2934,6 +2934,8 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change) pi->peering_crush_bucket_barrier, t->peering_crush_mandatory_member, pi->peering_crush_mandatory_member, + t->allows_ecoptimizations, + pi->allows_ecoptimizations(), prev_pgid)) { force_resend = true; } @@ -2989,6 +2991,7 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change) t->peering_crush_bucket_target = pi->peering_crush_bucket_target; t->peering_crush_bucket_barrier = pi->peering_crush_bucket_barrier; t->peering_crush_mandatory_member = pi->peering_crush_mandatory_member; + t->allows_ecoptimizations = pi->allows_ecoptimizations(); ldout(cct, 10) << __func__ << " " << " raw pgid " << pgid << " -> actual " << t->actual_pgid << " acting " << t->acting diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 862d4d0cdaf1d..f9a985c4f21dd 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1856,6 +1856,7 @@ public: int min_size = -1; ///< the min size of the pool when were were last mapped bool sort_bitwise = false; ///< whether the hobject_t sort order is bitwise bool recovery_deletes = false; ///< whether the deletes are performed during recovery instead of peering + bool allows_ecoptimizations = false; ///< whether EC plugin optimizations are enabled. uint32_t peering_crush_bucket_count = 0; uint32_t peering_crush_bucket_target = 0; uint32_t peering_crush_bucket_barrier = 0;