This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 4943e33 [client-test] KUDU-2612 remove FinalizeCommitTransaction
4943e33 is described below
commit 4943e338307bd7e886a10fb6f8bccb2377f88d27
Author: Alexey Serbin <[email protected]>
AuthorDate: Fri Jul 9 15:08:06 2021 -0700
[client-test] KUDU-2612 remove FinalizeCommitTransaction
This changelist addresses TODO in client-test, removing some cruft left
from earlier phases of the txn-related work: FinalizeCommitTransaction()
helper method is no longer needed because the transaction orchestration
is already present.
This patch doesn't contain any functional modifications.
Change-Id: I8e5867cce9cb7e06e4b83ba85a40b6f9855bda7b
Reviewed-on: http://gerrit.cloudera.org:8080/17668
Reviewed-by: Andrew Wong <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
---
src/kudu/client/client-test.cc | 42 ------------------------------------------
1 file changed, 42 deletions(-)
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index 2dd82a0..f6ad605 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -103,9 +103,7 @@
#include "kudu/tablet/tablet.h"
#include "kudu/tablet/tablet_metadata.h"
#include "kudu/tablet/tablet_replica.h"
-#include "kudu/tablet/txn_coordinator.h"
#include "kudu/transactions/transactions.pb.h"
-#include "kudu/transactions/txn_status_manager.h"
#include "kudu/tserver/mini_tablet_server.h"
#include "kudu/tserver/scanners.h"
#include "kudu/tserver/tablet_server.h"
@@ -206,7 +204,6 @@ using kudu::rpc::MessengerBuilder;
using kudu::security::SignedTokenPB;
using kudu::client::sp::shared_ptr;
using kudu::tablet::TabletReplica;
-using kudu::transactions::TxnStatusManager;
using kudu::transactions::TxnTokenPB;
using kudu::tserver::MiniTabletServer;
using std::function;
@@ -388,45 +385,6 @@ class ClientTest : public KuduTest {
}
}
- // TODO(aserbin): consider removing this method and update the scenarios it
- // was used once the transaction orchestration is implemented
- Status FinalizeCommitTransaction(int64_t txn_id) {
- for (auto i = 0; i < cluster_->num_tablet_servers(); ++i) {
- auto* tm = cluster_->mini_tablet_server(i)->server()->tablet_manager();
- vector<scoped_refptr<TabletReplica>> replicas;
- tm->GetTabletReplicas(&replicas);
- for (auto& r : replicas) {
- auto* c = r->txn_coordinator();
- if (!c) {
- continue;
- }
- TxnStatusManager::ScopedLeaderSharedLock l(c);
- auto highest_txn_id = c->highest_txn_id();
- if (txn_id > highest_txn_id) {
- continue;
- }
- tserver::TabletServerErrorPB ts_error;
- auto s = c->FinalizeCommitTransaction(txn_id,
Timestamp::kInitialTimestamp, &ts_error);
- if (s.IsNotFound()) {
- continue;
- }
- return s;
- }
- }
- return Status::NotFound(Substitute("transaction $0 not found", txn_id));
- }
-
- // TODO(aserbin): remove this method and update the scenarios it's used
- // once the transaction orchestration is implemented
- Status FinalizeCommitTransaction(const shared_ptr<KuduTransaction>& txn) {
- string txn_token;
- RETURN_NOT_OK(txn->Serialize(&txn_token));
- TxnTokenPB token;
- CHECK(token.ParseFromString(txn_token));
- CHECK(token.has_txn_id());
- return FinalizeCommitTransaction(token.txn_id());
- }
-
// Return the number of lookup-related RPCs which have been serviced by the
master.
int CountMasterLookupRPCs() const {
auto ent = cluster_->mini_master()->master()->metric_entity();