From 64f8dffee6667f2fdddaed52c5e46e83413d6af6 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 9 Feb 2021 19:03:43 -0500 Subject: [PATCH] rgw: rename rgw_data_change::gen_id Signed-off-by: Casey Bodley --- src/rgw/rgw_data_sync.cc | 2 +- src/rgw/rgw_datalog.cc | 10 +++++----- src/rgw/rgw_datalog.h | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index deebdb8c5ed2c..33dae00e9b666 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1735,7 +1735,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); } diff --git a/src/rgw/rgw_datalog.cc b/src/rgw/rgw_datalog.cc index 4903f447ff6b5..7d9e03a663e4a 100644 --- a/src/rgw/rgw_datalog.cc +++ b/src/rgw/rgw_datalog.cc @@ -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; diff --git a/src/rgw/rgw_datalog.h b/src/rgw/rgw_datalog.h index 2e1e0e990ab7f..1322c27043171 100644 --- a/src/rgw/rgw_datalog.h +++ b/src/rgw/rgw_datalog.h @@ -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); } -- 2.39.5