Skip to content

Commit

Permalink
[improve](txn insert) Txn load support cloud mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mymeiyi committed Jun 4, 2024
1 parent f7ca8fe commit 8981044
Show file tree
Hide file tree
Showing 19 changed files with 2,255 additions and 484 deletions.
2 changes: 2 additions & 0 deletions cloud/src/common/bvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ BvarLatencyRecorderWithTag g_bvar_ms_commit_txn("ms", "commit_txn");
BvarLatencyRecorderWithTag g_bvar_ms_abort_txn("ms", "abort_txn");
BvarLatencyRecorderWithTag g_bvar_ms_get_txn("ms", "get_txn");
BvarLatencyRecorderWithTag g_bvar_ms_get_current_max_txn_id("ms", "get_current_max_txn_id");
BvarLatencyRecorderWithTag g_bvar_ms_begin_sub_txn("ms", "begin_sub_txn");
BvarLatencyRecorderWithTag g_bvar_ms_abort_sub_txn("ms", "abort_sub_txn");
BvarLatencyRecorderWithTag g_bvar_ms_check_txn_conflict("ms", "check_txn_conflict");
BvarLatencyRecorderWithTag g_bvar_ms_clean_txn_label("ms", "clean_txn_label");
BvarLatencyRecorderWithTag g_bvar_ms_get_version("ms", "get_version");
Expand Down
2 changes: 2 additions & 0 deletions cloud/src/common/bvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ extern BvarLatencyRecorderWithTag g_bvar_ms_abort_txn;
extern BvarLatencyRecorderWithTag g_bvar_ms_get_txn;
extern BvarLatencyRecorderWithTag g_bvar_ms_get_current_max_txn_id;
extern BvarLatencyRecorderWithTag g_bvar_ms_check_txn_conflict;
extern BvarLatencyRecorderWithTag g_bvar_ms_begin_sub_txn;
extern BvarLatencyRecorderWithTag g_bvar_ms_abort_sub_txn;
extern BvarLatencyRecorderWithTag g_bvar_ms_clean_txn_label;
extern BvarLatencyRecorderWithTag g_bvar_ms_get_version;
extern BvarLatencyRecorderWithTag g_bvar_ms_batch_get_version;
Expand Down
24 changes: 24 additions & 0 deletions cloud/src/meta-service/meta_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class MetaServiceImpl : public cloud::MetaService {
void commit_txn(::google::protobuf::RpcController* controller, const CommitTxnRequest* request,
CommitTxnResponse* response, ::google::protobuf::Closure* done) override;

void commit_txn_with_sub_txn(::google::protobuf::RpcController* controller,
const CommitTxnRequest* request, CommitTxnResponse* response,
::google::protobuf::Closure* done);

void abort_txn(::google::protobuf::RpcController* controller, const AbortTxnRequest* request,
AbortTxnResponse* response, ::google::protobuf::Closure* done) override;

Expand All @@ -76,6 +80,14 @@ class MetaServiceImpl : public cloud::MetaService {
GetCurrentMaxTxnResponse* response,
::google::protobuf::Closure* done) override;

void begin_sub_txn(::google::protobuf::RpcController* controller,
const BeginSubTxnRequest* request, BeginSubTxnResponse* response,
::google::protobuf::Closure* done) override;

void abort_sub_txn(::google::protobuf::RpcController* controller,
const AbortSubTxnRequest* request, AbortSubTxnResponse* response,
::google::protobuf::Closure* done) override;

void check_txn_conflict(::google::protobuf::RpcController* controller,
const CheckTxnConflictRequest* request,
CheckTxnConflictResponse* response,
Expand Down Expand Up @@ -321,6 +333,18 @@ class MetaServiceProxy final : public MetaService {
call_impl(&cloud::MetaService::get_current_max_txn_id, controller, request, response, done);
}

void begin_sub_txn(::google::protobuf::RpcController* controller,
const BeginSubTxnRequest* request, BeginSubTxnResponse* response,
::google::protobuf::Closure* done) override {
call_impl(&cloud::MetaService::begin_sub_txn, controller, request, response, done);
}

void abort_sub_txn(::google::protobuf::RpcController* controller,
const AbortSubTxnRequest* request, AbortSubTxnResponse* response,
::google::protobuf::Closure* done) override {
call_impl(&cloud::MetaService::abort_sub_txn, controller, request, response, done);
}

void check_txn_conflict(::google::protobuf::RpcController* controller,
const CheckTxnConflictRequest* request,
CheckTxnConflictResponse* response,
Expand Down
Loading

0 comments on commit 8981044

Please sign in to comment.