From: Matan Breizman Date: Tue, 21 Jul 2026 08:41:58 +0000 (+0000) Subject: crimson/seastore: batch only txns with matching data_features X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6cae08dcc8a93c211a9f9163786a9b5988efd933;p=ceph.git crimson/seastore: batch only txns with matching data_features 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 --- diff --git a/src/crimson/os/seastore/seastore.cc b/src/crimson/os/seastore/seastore.cc index f3adba4c156c..15c9a3fcb1f5 100644 --- a/src/crimson/os/seastore/seastore.cc +++ b/src/crimson/os/seastore/seastore.cc @@ -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; } } diff --git a/src/os/Transaction.h b/src/os/Transaction.h index 220e701f45dc..c226e0399a34 100644 --- a/src/os/Transaction.h +++ b/src/os/Transaction.h @@ -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);