]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/seastore: batch only txns with matching data_features
authorMatan Breizman <mbreizma@redhat.com>
Tue, 21 Jul 2026 08:41:58 +0000 (08:41 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 22 Jul 2026 09:15:57 +0000 (09:15 +0000)
Transaction::append() asserts both transactions share data_features.
The per-collection batcher merged queued client txns unconditionally,
so a data_features mismatch would be asserted in build_next_batch().

Use diffrent data_features as a grouping boundary.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/os/seastore/seastore.cc
src/os/Transaction.h

index f3adba4c156cdb4c2a52ffafd001716da2c372bc..15c9a3fcb1f55a7f1013f6887107f475a047d297 100644 (file)
@@ -1772,16 +1772,18 @@ ceph::os::Transaction SeaStore::Shard::build_next_batch(
 {
   ceph::os::Transaction merged;
   bool first = true;
+  uint64_t batch_features = 0;
   while (!coll.pending_txns.empty()) {
     const bool no_batch = !coll.pending_txns.front().batchable;
-    if (no_batch && !first) {
-      // Mid-batch: seal what we have and leave this txn to run as its own
-      // next batch (it will be `first` there and take the solo path below).
+    if (!first &&
+        (no_batch || coll.pending_txns.front().txn.get_data_features() != batch_features)) {
+      // Batch boundary: seal what we have so far in the batch
       break;
     }
     auto e = std::move(coll.pending_txns.front());
     coll.pending_txns.pop_front();
     if (first) {
+      batch_features = e.txn.get_data_features();
       merged = std::move(e.txn);
       first = false;
     } else {
@@ -1789,6 +1791,7 @@ ceph::os::Transaction SeaStore::Shard::build_next_batch(
     }
     pending_txns_promises.push_back(std::move(e.pr));
     if (no_batch) {
+      // no_batch runs solo (never is appended)
       break;
     }
   }
index 220e701f45dc87dcde87ec999fd2cb8bb3f0a7f5..c226e0399a342c7d4677d506b04ceeb1e9043e39 100644 (file)
@@ -393,6 +393,8 @@ public:
   }
   uint32_t get_fadvise_flags() { return data.fadvise_flags; }
 
+  uint64_t get_data_features() const { return data_features; }
+
   void swap(Transaction& other) noexcept {
     std::swap(data, other.data);
     std::swap(on_applied, other.on_applied);