]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: roll_forward_to->pg_committed_to in EC*
authorSamuel Just <sjust@redhat.com>
Fri, 29 Mar 2024 21:45:39 +0000 (14:45 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 18 Oct 2024 20:33:57 +0000 (20:33 +0000)
The purpose of this rename is merely to clarify that the necessary
condition on ec roll-forward is that the pg has committed up to that
point.  Along with subsequent commits, this will clarify that both ec
and replicated pools propagate pg_committed_to for related if not
identical reasons.  Because EC::submit_transaction already did

  op->roll_forward_to = std::max(min_last_complete_ondisk, rmw_pipeline.committed_to);

there's no difference in behavior as rmw_pipeline.committed_to is
updated immediately after the notification to the PG that the write
completed.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ECBackend.cc
src/osd/ECBackend.h
src/osd/ECCommon.cc
src/osd/ECCommon.h
src/osd/ECMsgTypes.cc
src/osd/ECMsgTypes.h

index beb9eacfd2a53aa123a60bbdc7946abd88a1e26b..cab6bbb3acbe450c169b21633e16b973c84280fe 100644 (file)
@@ -983,8 +983,8 @@ void ECBackend::handle_sub_write(
     std::move(op.log_entries),
     op.updated_hit_set_history,
     op.trim_to,
-    op.roll_forward_to,
-    op.roll_forward_to,
+    op.pg_committed_to,
+    op.pg_committed_to,
     !op.backfill_or_async_recovery,
     localt,
     async);
@@ -1470,7 +1470,7 @@ void ECBackend::submit_transaction(
   const eversion_t &at_version,
   PGTransactionUPtr &&t,
   const eversion_t &trim_to,
-  const eversion_t &min_last_complete_ondisk,
+  const eversion_t &pg_committed_to,
   vector<pg_log_entry_t>&& log_entries,
   std::optional<pg_hit_set_history_t> &hset_history,
   Context *on_all_commit,
@@ -1485,7 +1485,7 @@ void ECBackend::submit_transaction(
   op->delta_stats = delta_stats;
   op->version = at_version;
   op->trim_to = trim_to;
-  op->roll_forward_to = std::max(min_last_complete_ondisk, rmw_pipeline.committed_to);
+  op->pg_committed_to = std::max(pg_committed_to, rmw_pipeline.committed_to);
   op->log_entries = log_entries;
   std::swap(op->updated_hit_set_history, hset_history);
   op->on_all_commit = on_all_commit;
index 910cdc064e4ff4f8fd7baaff0fb5147273c7052a..46317b608326856fe98162533bfb50ff0e889c54 100644 (file)
@@ -106,7 +106,7 @@ public:
     const eversion_t &at_version,
     PGTransactionUPtr &&t,
     const eversion_t &trim_to,
-    const eversion_t &min_last_complete_ondisk,
+    const eversion_t &pg_committed_to,
     std::vector<pg_log_entry_t>&& log_entries,
     std::optional<pg_hit_set_history_t> &hset_history,
     Context *on_all_commit,
index 1fc8761050298895ec324b3fb89b6c9fa3834e87..609ac3141ae30f7f42400d80bbfe26370d13e033 100644 (file)
@@ -158,7 +158,7 @@ ostream &operator<<(ostream &lhs, const ECCommon::RMWPipeline::Op &rhs)
     rhs.client_op->get_req()->print(lhs);
   }
 #endif
-  lhs << " roll_forward_to=" << rhs.roll_forward_to
+  lhs << " pg_committed_to=" << rhs.pg_committed_to
       << " temp_added=" << rhs.temp_added
       << " temp_cleared=" << rhs.temp_cleared
       << " pending_read=" << rhs.pending_read
@@ -895,7 +895,7 @@ bool ECCommon::RMWPipeline::try_reads_to_commit()
       should_send ? iter->second : empty,
       op->version,
       op->trim_to,
-      op->roll_forward_to,
+      op->pg_committed_to,
       op->log_entries,
       op->updated_hit_set_history,
       op->temp_added,
@@ -970,8 +970,8 @@ bool ECCommon::RMWPipeline::try_finish_rmw()
   dout(10) << __func__ << ": " << *op << dendl;
   dout(20) << __func__ << ": " << cache << dendl;
 
-  if (op->roll_forward_to > completed_to)
-    completed_to = op->roll_forward_to;
+  if (op->pg_committed_to > completed_to)
+    completed_to = op->pg_committed_to;
   if (op->version > committed_to)
     committed_to = op->version;
 
@@ -984,7 +984,7 @@ bool ECCommon::RMWPipeline::try_finish_rmw()
       auto nop = std::make_unique<ECDummyOp>();
       nop->hoid = op->hoid;
       nop->trim_to = op->trim_to;
-      nop->roll_forward_to = op->version;
+      nop->pg_committed_to = op->version;
       nop->tid = tid;
       nop->reqid = op->reqid;
       waiting_reads.push_back(*nop);
index 88f2940111ec906558d11f140f2d5b2a9e700d15..edde95b6ac563c99e855529f0434f7736bd2d1a0 100644 (file)
@@ -522,7 +522,7 @@ struct ECCommon {
       osd_reqid_t reqid;
       ZTracer::Trace trace;
 
-      eversion_t roll_forward_to; /// Soon to be generated internally
+      eversion_t pg_committed_to; /// Soon to be generated internally
 
       /// Ancillary also provided from submit_transaction caller
       std::map<hobject_t, ObjectContextRef> obc_map;
index a656766432f57ccd4d5b3f1cd70efc6cc5c32acb..ae0636f7d492a3f2b1605fcc58abf691b495e8d9 100644 (file)
@@ -37,7 +37,7 @@ void ECSubWrite::encode(bufferlist &bl) const
   encode(temp_added, bl);
   encode(temp_removed, bl);
   encode(updated_hit_set_history, bl);
-  encode(roll_forward_to, bl);
+  encode(pg_committed_to, bl);
   encode(backfill_or_async_recovery, bl);
   ENCODE_FINISH(bl);
 }
@@ -60,9 +60,9 @@ void ECSubWrite::decode(bufferlist::const_iterator &bl)
     decode(updated_hit_set_history, bl);
   }
   if (struct_v >= 3) {
-    decode(roll_forward_to, bl);
+    decode(pg_committed_to, bl);
   } else {
-    roll_forward_to = trim_to;
+    pg_committed_to = trim_to;
   }
   if (struct_v >= 4) {
     decode(backfill_or_async_recovery, bl);
@@ -80,7 +80,7 @@ std::ostream &operator<<(
       << ", reqid=" << rhs.reqid
       << ", at_version=" << rhs.at_version
       << ", trim_to=" << rhs.trim_to
-      << ", roll_forward_to=" << rhs.roll_forward_to;
+      << ", pg_committed_to=" << rhs.pg_committed_to;
   if (rhs.updated_hit_set_history)
     lhs << ", has_updated_hit_set_history";
   if (rhs.backfill_or_async_recovery)
@@ -94,7 +94,7 @@ void ECSubWrite::dump(Formatter *f) const
   f->dump_stream("reqid") << reqid;
   f->dump_stream("at_version") << at_version;
   f->dump_stream("trim_to") << trim_to;
-  f->dump_stream("roll_forward_to") << roll_forward_to;
+  f->dump_stream("pg_committed_to") << pg_committed_to;
   f->dump_bool("has_updated_hit_set_history",
       static_cast<bool>(updated_hit_set_history));
   f->dump_bool("backfill_or_async_recovery", backfill_or_async_recovery);
@@ -116,7 +116,7 @@ void ECSubWrite::generate_test_instances(list<ECSubWrite*> &o)
   o.back()->reqid = osd_reqid_t(entity_name_t::CLIENT(123), 1, 45678);
   o.back()->at_version = eversion_t(10, 300);
   o.back()->trim_to = eversion_t(5, 42);
-  o.back()->roll_forward_to = eversion_t(8, 250);
+  o.back()->pg_committed_to = eversion_t(8, 250);
 }
 
 void ECSubWriteReply::encode(bufferlist &bl) const
index 2d0bc5c122161adfa4d4c29d23e72d76ad5af8a8..d0df1ad6fa15371b00eb07a2d58b89b6384e8a2a 100644 (file)
@@ -31,7 +31,7 @@ struct ECSubWrite {
   ObjectStore::Transaction t;
   eversion_t at_version;
   eversion_t trim_to;
-  eversion_t roll_forward_to;
+  eversion_t pg_committed_to;
   std::vector<pg_log_entry_t> log_entries;
   std::set<hobject_t> temp_added;
   std::set<hobject_t> temp_removed;
@@ -47,7 +47,7 @@ struct ECSubWrite {
     const ObjectStore::Transaction &t,
     eversion_t at_version,
     eversion_t trim_to,
-    eversion_t roll_forward_to,
+    eversion_t pg_committed_to,
     std::vector<pg_log_entry_t> log_entries,
     std::optional<pg_hit_set_history_t> updated_hit_set_history,
     const std::set<hobject_t> &temp_added,
@@ -56,7 +56,7 @@ struct ECSubWrite {
     : from(from), tid(tid), reqid(reqid),
       soid(soid), stats(stats), t(t),
       at_version(at_version),
-      trim_to(trim_to), roll_forward_to(roll_forward_to),
+      trim_to(trim_to), pg_committed_to(pg_committed_to),
       log_entries(log_entries),
       temp_added(temp_added),
       temp_removed(temp_removed),
@@ -72,7 +72,7 @@ struct ECSubWrite {
     t.swap(other.t);
     at_version = other.at_version;
     trim_to = other.trim_to;
-    roll_forward_to = other.roll_forward_to;
+    pg_committed_to = other.pg_committed_to;
     log_entries.swap(other.log_entries);
     temp_added.swap(other.temp_added);
     temp_removed.swap(other.temp_removed);