From: xie xingguo Date: Sat, 11 Mar 2017 09:06:07 +0000 (+0800) Subject: OSD: drop parameter t from proc_replica_log() X-Git-Tag: v12.0.1~22^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65e049227617c06ff42518510bc86758a2312b03;p=ceph.git OSD: drop parameter t from proc_replica_log() Which is definitely unnecessary. Signed-off-by: xie xingguo --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 82741249f5a3..9545693d66b9 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -339,7 +339,6 @@ void PG::proc_master_log( } void PG::proc_replica_log( - ObjectStore::Transaction& t, pg_info_t &oinfo, const pg_log_t &olog, pg_missing_t& omissing, @@ -348,7 +347,7 @@ void PG::proc_replica_log( dout(10) << "proc_replica_log for osd." << from << ": " << oinfo << " " << olog << " " << omissing << dendl; - pg_log.proc_replica_log(t, oinfo, olog, omissing, from); + pg_log.proc_replica_log(oinfo, olog, omissing, from); peer_info[from] = oinfo; dout(10) << " peer osd." << from << " now " << oinfo << " " << omissing << dendl; @@ -6958,7 +6957,6 @@ boost::statechart::result PG::RecoveryState::Active::react(const MLogRec& logevt ldout(pg->cct, 10) << "searching osd." << logevt.from << " log for unfound items" << dendl; pg->proc_replica_log( - *context().get_cur_transaction(), logevt.msg->info, logevt.msg->log, logevt.msg->missing, logevt.from); bool got_missing = pg->search_for_missing( pg->peer_info[logevt.from], @@ -7887,8 +7885,7 @@ boost::statechart::result PG::RecoveryState::GetMissing::react(const MLogRec& lo PG *pg = context< RecoveryMachine >().pg; peer_missing_requested.erase(logevt.from); - pg->proc_replica_log(*context().get_cur_transaction(), - logevt.msg->info, logevt.msg->log, logevt.msg->missing, logevt.from); + pg->proc_replica_log(logevt.msg->info, logevt.msg->log, logevt.msg->missing, logevt.from); if (peer_missing_requested.empty()) { if (pg->need_up_thru) { diff --git a/src/osd/PG.h b/src/osd/PG.h index dbbac2df8eea..16ba57be1f78 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -968,8 +968,7 @@ public: virtual void calc_trim_to() = 0; - void proc_replica_log(ObjectStore::Transaction& t, - pg_info_t &oinfo, const pg_log_t &olog, + void proc_replica_log(pg_info_t &oinfo, const pg_log_t &olog, pg_missing_t& omissing, pg_shard_t from); void proc_master_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog, pg_missing_t& omissing, pg_shard_t from); diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc index b5e145b268db..63e1cdfc0262 100644 --- a/src/osd/PGLog.cc +++ b/src/osd/PGLog.cc @@ -130,7 +130,6 @@ void PGLog::trim( } void PGLog::proc_replica_log( - ObjectStore::Transaction& t, pg_info_t &oinfo, const pg_log_t &olog, pg_missing_t& omissing, diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 527c42b58ca8..d67faab20e95 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -703,8 +703,7 @@ public: log.last_requested = 0; } - void proc_replica_log(ObjectStore::Transaction& t, - pg_info_t &oinfo, + void proc_replica_log(pg_info_t &oinfo, const pg_log_t &olog, pg_missing_t& omissing, pg_shard_t from) const; diff --git a/src/test/osd/TestPGLog.cc b/src/test/osd/TestPGLog.cc index 15a433e78fc9..b052442e4f85 100644 --- a/src/test/osd/TestPGLog.cc +++ b/src/test/osd/TestPGLog.cc @@ -237,7 +237,6 @@ public: }; void test_proc_replica_log(const TestCase &tcase) { clear(); - ObjectStore::Transaction t; log = tcase.get_fullauth(); pg_info_t info = tcase.get_authinfo(); @@ -248,7 +247,7 @@ public: pg_info_t oinfo = tcase.get_divinfo(); proc_replica_log( - t, oinfo, olog, omissing, pg_shard_t(1, shard_id_t(0))); + oinfo, olog, omissing, pg_shard_t(1, shard_id_t(0))); assert(oinfo.last_update >= log.tail); @@ -1223,7 +1222,6 @@ TEST_F(PGLogTest, proc_replica_log) { { clear(); - ObjectStore::Transaction t; pg_log_t olog; pg_info_t oinfo; pg_missing_t omissing; @@ -1234,14 +1232,12 @@ TEST_F(PGLogTest, proc_replica_log) { eversion_t last_complete(1, 1); oinfo.last_complete = last_complete; - EXPECT_TRUE(t.empty()); EXPECT_FALSE(omissing.have_missing()); EXPECT_EQ(last_update, oinfo.last_update); EXPECT_EQ(last_complete, oinfo.last_complete); - proc_replica_log(t, oinfo, olog, omissing, from); + proc_replica_log(oinfo, olog, omissing, from); - EXPECT_TRUE(t.empty()); EXPECT_FALSE(omissing.have_missing()); EXPECT_EQ(last_update, oinfo.last_update); EXPECT_EQ(last_update, oinfo.last_complete); @@ -1275,7 +1271,6 @@ TEST_F(PGLogTest, proc_replica_log) { { clear(); - ObjectStore::Transaction t; pg_log_t olog; pg_info_t oinfo; pg_missing_t omissing; @@ -1310,21 +1305,18 @@ TEST_F(PGLogTest, proc_replica_log) { oinfo.last_complete = olog.head; } - EXPECT_TRUE(t.empty()); EXPECT_FALSE(omissing.have_missing()); EXPECT_EQ(olog.head, oinfo.last_update); EXPECT_EQ(olog.head, oinfo.last_complete); - proc_replica_log(t, oinfo, olog, omissing, from); + proc_replica_log(oinfo, olog, omissing, from); - EXPECT_TRUE(t.empty()); EXPECT_FALSE(omissing.have_missing()); } { clear(); - ObjectStore::Transaction t; pg_log_t olog; pg_info_t oinfo; pg_missing_t omissing; @@ -1414,14 +1406,12 @@ TEST_F(PGLogTest, proc_replica_log) { oinfo.last_complete = olog.head; } - EXPECT_TRUE(t.empty()); EXPECT_FALSE(omissing.have_missing()); EXPECT_EQ(olog.head, oinfo.last_update); EXPECT_EQ(olog.head, oinfo.last_complete); - proc_replica_log(t, oinfo, olog, omissing, from); + proc_replica_log(oinfo, olog, omissing, from); - EXPECT_TRUE(t.empty()); EXPECT_TRUE(omissing.have_missing()); EXPECT_TRUE(omissing.is_missing(divergent_object)); EXPECT_EQ(eversion_t(1, 2), omissing.get_items().at(divergent_object).need); @@ -1456,7 +1446,6 @@ TEST_F(PGLogTest, proc_replica_log) { { clear(); - ObjectStore::Transaction t; pg_log_t olog; pg_info_t oinfo; pg_missing_t omissing; @@ -1503,14 +1492,12 @@ TEST_F(PGLogTest, proc_replica_log) { oinfo.last_complete = olog.head; } - EXPECT_TRUE(t.empty()); EXPECT_FALSE(omissing.have_missing()); EXPECT_EQ(olog.head, oinfo.last_update); EXPECT_EQ(olog.head, oinfo.last_complete); - proc_replica_log(t, oinfo, olog, omissing, from); + proc_replica_log(oinfo, olog, omissing, from); - EXPECT_TRUE(t.empty()); EXPECT_TRUE(omissing.have_missing()); EXPECT_TRUE(omissing.is_missing(divergent_object)); EXPECT_EQ(omissing.get_items().at(divergent_object).have, eversion_t(0, 0)); @@ -1545,7 +1532,6 @@ TEST_F(PGLogTest, proc_replica_log) { { clear(); - ObjectStore::Transaction t; pg_log_t olog; pg_info_t oinfo; pg_missing_t omissing; @@ -1593,16 +1579,14 @@ TEST_F(PGLogTest, proc_replica_log) { oinfo.last_complete = olog.head; } - EXPECT_TRUE(t.empty()); EXPECT_TRUE(omissing.have_missing()); EXPECT_TRUE(omissing.is_missing(divergent_object)); EXPECT_EQ(eversion_t(1, 3), omissing.get_items().at(divergent_object).need); EXPECT_EQ(olog.head, oinfo.last_update); EXPECT_EQ(olog.head, oinfo.last_complete); - proc_replica_log(t, oinfo, olog, omissing, from); + proc_replica_log(oinfo, olog, omissing, from); - EXPECT_TRUE(t.empty()); EXPECT_TRUE(omissing.have_missing()); EXPECT_TRUE(omissing.is_missing(divergent_object)); EXPECT_EQ(omissing.get_items().at(divergent_object).have, eversion_t(0, 0)); @@ -1638,7 +1622,6 @@ TEST_F(PGLogTest, proc_replica_log) { { clear(); - ObjectStore::Transaction t; pg_log_t olog; pg_info_t oinfo; pg_missing_t omissing; @@ -1689,16 +1672,14 @@ TEST_F(PGLogTest, proc_replica_log) { oinfo.last_complete = olog.head; } - EXPECT_TRUE(t.empty()); EXPECT_TRUE(omissing.have_missing()); EXPECT_TRUE(omissing.is_missing(divergent_object)); EXPECT_EQ(divergent_version, omissing.get_items().at(divergent_object).need); EXPECT_EQ(olog.head, oinfo.last_update); EXPECT_EQ(olog.head, oinfo.last_complete); - proc_replica_log(t, oinfo, olog, omissing, from); + proc_replica_log(oinfo, olog, omissing, from); - EXPECT_TRUE(t.empty()); EXPECT_TRUE(omissing.have_missing()); EXPECT_TRUE(omissing.get_items().begin()->second.need == eversion_t(1, 1)); EXPECT_EQ(last_update, oinfo.last_update);