]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: Optimized EC pools - fix overaggressive assert in read_log_and_missing
authorBill Scales <bill_scales@uk.ibm.com>
Mon, 23 Jun 2025 09:24:17 +0000 (10:24 +0100)
committerAlex Ainscow <aainscow@uk.ibm.com>
Sun, 7 Sep 2025 23:10:41 +0000 (00:10 +0100)
Non-primary shards may not be updated because of partial writes. This means
that the OI verison for an object on these shards may be stale. An assert
in read_log_and_missing was checking that the OI version matched the have
version in a missing entry. The missing entry calculates the have version
using the prior_version from a log entry, this does not take into account
partial writes so can be ahead of the stale OI version.

Relax the assert for optimized pools to require have >= oi.version

Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
(cherry picked from commit 74e138a7c1f8b7e375568c6811a60f6bdad181b3)

src/osd/PGLog.h

index f7d0386d9cf8104c9f9c0b359dfa03cf265c94db..eea032b780d5cbc06b4f82d95f5fc72932129e58 100644 (file)
@@ -1719,7 +1719,14 @@ public:
                ceph_assert(miter->second.need == i->version);
                // the 'have' version is reset if an object is deleted,
                // then created again
-               ceph_assert(miter->second.have == oi.version || miter->second.have == eversion_t());
+               if (ec_optimizations_enabled) {
+                 // non-primary shards in an optimized pool may not have updates
+                 // because of partial writes, which may result in oi.version being
+                 // less than have
+                 ceph_assert(miter->second.have >= oi.version || miter->second.have == eversion_t());
+               } else {
+                 ceph_assert(miter->second.have == oi.version || miter->second.have == eversion_t());
+               }
                checked.insert(i->soid);
              } else {
                missing.add(i->soid, i->version, oi.version, i->is_delete());