]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: rename rgw_data_change::gen_id
authorCasey Bodley <cbodley@redhat.com>
Wed, 10 Feb 2021 00:03:43 +0000 (19:03 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 1 Feb 2022 15:56:21 +0000 (10:56 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_data_sync.cc
src/rgw/rgw_datalog.cc
src/rgw/rgw_datalog.h

index 1db7a50331d19ccb8dd377c7a8715428d431fc10..5908658ea9cb8a94d8fed44f7e066699ffc15211 100644 (file)
@@ -1741,7 +1741,7 @@ public:
           if (!marker_tracker->start(log_iter->log_id, 0, log_iter->log_timestamp)) {
             tn->log(0, SSTR("ERROR: cannot start syncing " << log_iter->log_id << ". Duplicate entry?"));
           } else {
-            spawn(sync_single_entry(source_bs, std::nullopt, log_iter->log_id,
+            spawn(sync_single_entry(source_bs, log_iter->entry.gen, log_iter->log_id,
                                     log_iter->log_timestamp, false), false);
           }
 
index 9312a234111ea46d7db8db5f13143a170a9fa49e..4a69fbfb06e2c8dd4b9530175f242ed7c5f0aece 100644 (file)
@@ -42,7 +42,7 @@ void rgw_data_change::dump(ceph::Formatter *f) const
   encode_json("key", key, f);
   utime_t ut(timestamp);
   encode_json("timestamp", ut, f);
-  encode_json("gen_id", gen_id, f);
+  encode_json("gen", gen, f);
 }
 
 void rgw_data_change::decode_json(JSONObj *obj) {
@@ -57,7 +57,7 @@ void rgw_data_change::decode_json(JSONObj *obj) {
   utime_t ut;
   JSONDecoder::decode_json("timestamp", ut, obj);
   timestamp = ut.to_real_time();
-  JSONDecoder::decode_json("gen_id", gen_id, obj);
+  JSONDecoder::decode_json("gen", gen, obj);
 }
 
 void rgw_data_change_log_entry::dump(Formatter *f) const
@@ -513,7 +513,7 @@ int RGWDataChangesLog::renew_entries(const DoutPrefixProvider *dpp)
 
   auto ut = real_clock::now();
   auto be = bes->head();
-  for (const auto& [bs, gen_id] : entries) {
+  for (const auto& [bs, gen] : entries) {
     auto index = choose_oid(bs);
 
     rgw_data_change change;
@@ -521,7 +521,7 @@ int RGWDataChangesLog::renew_entries(const DoutPrefixProvider *dpp)
     change.entity_type = ENTITY_TYPE_BUCKET;
     change.key = bs.get_key();
     change.timestamp = ut;
-    change.gen_id = gen_id;
+    change.gen = gen;
     encode(change, bl);
 
     m[index].first.push_back(bs);
@@ -682,7 +682,7 @@ int RGWDataChangesLog::add_entry(const DoutPrefixProvider *dpp,
     change.entity_type = ENTITY_TYPE_BUCKET;
     change.key = bs.get_key();
     change.timestamp = now;
-    change.gen_id = gen.gen;
+    change.gen = gen.gen;
     encode(change, bl);
 
     ldpp_dout(dpp, 20) << "RGWDataChangesLog::add_entry() sending update with now=" << now << " cur_expiration=" << expiration << dendl;
index 2e1e0e990ab7f4eb1bbe6cd4305b7740db1a8050..1322c27043171a0e2dbf2e9c482d6b68a9b66325 100644 (file)
@@ -52,7 +52,7 @@ struct rgw_data_change {
   DataLogEntityType entity_type;
   std::string key;
   ceph::real_time timestamp;
-  uint64_t gen_id;
+  uint64_t gen = 0;
 
   void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 2, bl);
@@ -60,7 +60,7 @@ struct rgw_data_change {
     encode(t, bl);
     encode(key, bl);
     encode(timestamp, bl);
-    encode(gen_id, bl);
+    encode(gen, bl);
     ENCODE_FINISH(bl);
   }
 
@@ -72,9 +72,9 @@ struct rgw_data_change {
      decode(key, bl);
      decode(timestamp, bl);
      if (struct_v < 2)
-       gen_id = 0;
+       gen = 0;
      else
-       decode(gen_id, bl);
+       decode(gen, bl);
      DECODE_FINISH(bl);
   }