Skip to content

Commit

Permalink
rename ExecuteOnProgress -> ProgressOnExecute (ydb-platform#6739)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored and zverevgeny committed Jul 23, 2024
1 parent 9727cbb commit d96d33d
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 19 deletions.
6 changes: 3 additions & 3 deletions ydb/core/tx/columnshard/columnshard__progress_tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TColumnShard::TTxProgressTx : public TTransactionBase<TColumnShard> {
Y_ABORT_UNLESS(Self->ProgressTxInFlight);
Self->TabletCounters->Simple()[COUNTER_TX_COMPLETE_LAG].Set(Self->GetTxCompleteLag().MilliSeconds());

size_t removedCount = Self->ProgressTxController->CleanExpiredTxs(txc);
const size_t removedCount = Self->ProgressTxController->CleanExpiredTxs(txc);
if (removedCount > 0) {
// We cannot continue with this transaction, start a new transaction
Self->Execute(new TTxProgressTx(Self), ctx);
Expand All @@ -41,7 +41,7 @@ class TColumnShard::TTxProgressTx : public TTransactionBase<TColumnShard> {
}

TxOperator = Self->ProgressTxController->GetVerifiedTxOperator(txId);
AFL_VERIFY(TxOperator->ExecuteOnProgress(*Self, NOlap::TSnapshot(step, txId), txc));
AFL_VERIFY(TxOperator->ProgressOnExecute(*Self, NOlap::TSnapshot(step, txId), txc));
Self->ProgressTxController->FinishPlannedTx(txId, txc);
}
return true;
Expand All @@ -50,7 +50,7 @@ class TColumnShard::TTxProgressTx : public TTransactionBase<TColumnShard> {
void Complete(const TActorContext& ctx) override {
NActors::TLogContextGuard logGuard = NActors::TLogContextBuilder::Build(NKikimrServices::TX_COLUMNSHARD)("tablet_id", Self->TabletID())("tx_state", "complete");
if (TxOperator) {
TxOperator->CompleteOnProgress(*Self, ctx);
TxOperator->ProgressOnComplete(*Self, ctx);
Self->RescheduleWaitingReads();
}
if (PlannedQueueItem) {
Expand Down
5 changes: 3 additions & 2 deletions ydb/core/tx/columnshard/transactions/operators/backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ void TBackupTransactionOperator::DoStartProposeOnComplete(TColumnShard& /*owner*
}
}

bool TBackupTransactionOperator::ExecuteOnProgress(TColumnShard& /*owner*/, const NOlap::TSnapshot& /*version*/, NTabletFlatExecutor::TTransactionContext& /*txc*/) {
bool TBackupTransactionOperator::ProgressOnExecute(
TColumnShard& /*owner*/, const NOlap::TSnapshot& /*version*/, NTabletFlatExecutor::TTransactionContext& /*txc*/) {
return true;
}

bool TBackupTransactionOperator::CompleteOnProgress(TColumnShard& /*owner*/, const TActorContext& /*ctx*/) {
bool TBackupTransactionOperator::ProgressOnComplete(TColumnShard& /*owner*/, const TActorContext& /*ctx*/) {
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/columnshard/transactions/operators/backup.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class TBackupTransactionOperator: public IProposeTxOperator {
public:
using TBase::TBase;

virtual bool ExecuteOnProgress(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override;
virtual bool ProgressOnExecute(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override;

virtual bool CompleteOnProgress(TColumnShard& owner, const TActorContext& ctx) override;
virtual bool ProgressOnComplete(TColumnShard& owner, const TActorContext& ctx) override;

virtual bool ExecuteOnAbort(TColumnShard& owner, NTabletFlatExecutor::TTransactionContext& txc) override;
virtual bool CompleteOnAbort(TColumnShard& /*owner*/, const TActorContext& /*ctx*/) override {
Expand Down
5 changes: 3 additions & 2 deletions ydb/core/tx/columnshard/transactions/operators/ev_write.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ namespace NKikimr::NColumnShard {
public:
using TBase::TBase;

virtual bool ExecuteOnProgress(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override {
virtual bool ProgressOnExecute(
TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override {
return owner.OperationsManager->CommitTransaction(owner, GetTxId(), txc, version);
}

virtual bool CompleteOnProgress(TColumnShard& owner, const TActorContext& ctx) override {
virtual bool ProgressOnComplete(TColumnShard& owner, const TActorContext& ctx) override {
auto result = NEvents::TDataEvents::TEvWriteResult::BuildCompleted(owner.TabletID(), GetTxId());
ctx.Send(TxInfo.Source, result.release(), 0, TxInfo.Cookie);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace NKikimr::NColumnShard {
}
}

bool ExecuteOnProgress(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override {
bool ProgressOnExecute(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override {
TBlobGroupSelector dsGroupSelector(owner.Info());
NOlap::TDbWrapper dbTable(txc.DB, &dsGroupSelector);

Expand All @@ -66,7 +66,7 @@ namespace NKikimr::NColumnShard {
return true;
}

bool CompleteOnProgress(TColumnShard& owner, const TActorContext& ctx) override {
bool ProgressOnComplete(TColumnShard& owner, const TActorContext& ctx) override {
auto result = std::make_unique<TEvColumnShard::TEvProposeTransactionResult>(owner.TabletID(), TxInfo.TxKind, GetTxId(), NKikimrTxColumnShard::SUCCESS);
result->Record.SetStep(TxInfo.PlanStep);
ctx.Send(TxInfo.Source, result.release(), 0, TxInfo.Cookie);
Expand Down
5 changes: 3 additions & 2 deletions ydb/core/tx/columnshard/transactions/operators/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class TSchemaTransactionOperator: public IProposeTxOperator {
public:
using TBase::TBase;

virtual bool ExecuteOnProgress(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override {
virtual bool ProgressOnExecute(
TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override {
if (!!TxAddSharding) {
auto* tx = dynamic_cast<TTxAddShardingInfo*>(TxAddSharding.get());
AFL_VERIFY(tx);
Expand All @@ -79,7 +80,7 @@ class TSchemaTransactionOperator: public IProposeTxOperator {
return true;
}

virtual bool CompleteOnProgress(TColumnShard& owner, const TActorContext& ctx) override {
virtual bool ProgressOnComplete(TColumnShard& owner, const TActorContext& ctx) override {
if (!!TxAddSharding) {
TxAddSharding->Complete(ctx);
}
Expand Down
5 changes: 3 additions & 2 deletions ydb/core/tx/columnshard/transactions/operators/sharing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ void TSharingTransactionOperator::DoStartProposeOnComplete(TColumnShard& /*owner
TxPropose.release();
}

bool TSharingTransactionOperator::ExecuteOnProgress(TColumnShard& /*owner*/, const NOlap::TSnapshot& /*version*/, NTabletFlatExecutor::TTransactionContext& /*txc*/) {
bool TSharingTransactionOperator::ProgressOnExecute(
TColumnShard& /*owner*/, const NOlap::TSnapshot& /*version*/, NTabletFlatExecutor::TTransactionContext& /*txc*/) {
return true;
}

bool TSharingTransactionOperator::CompleteOnProgress(TColumnShard& owner, const TActorContext& ctx) {
bool TSharingTransactionOperator::ProgressOnComplete(TColumnShard& owner, const TActorContext& ctx) {
for (TActorId subscriber : NotifySubscribers) {
auto event = MakeHolder<TEvColumnShard::TEvNotifyTxCompletionResult>(owner.TabletID(), GetTxId());
ctx.Send(subscriber, event.Release(), 0, 0);
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/columnshard/transactions/operators/sharing.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class TSharingTransactionOperator: public IProposeTxOperator {
NotifySubscribers.insert(actorId);
}

virtual bool ExecuteOnProgress(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override;
virtual bool ProgressOnExecute(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) override;

virtual bool CompleteOnProgress(TColumnShard& owner, const TActorContext& ctx) override;
virtual bool ProgressOnComplete(TColumnShard& owner, const TActorContext& ctx) override;

virtual bool ExecuteOnAbort(TColumnShard& owner, NTabletFlatExecutor::TTransactionContext& txc) override;
virtual bool CompleteOnAbort(TColumnShard& owner, const TActorContext& ctx) override;
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/columnshard/transactions/tx_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ class TTxController {
return DoFinishProposeOnComplete(owner, ctx);
}

virtual bool ExecuteOnProgress(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) = 0;
virtual bool CompleteOnProgress(TColumnShard& owner, const TActorContext& ctx) = 0;
virtual bool ProgressOnExecute(TColumnShard& owner, const NOlap::TSnapshot& version, NTabletFlatExecutor::TTransactionContext& txc) = 0;
virtual bool ProgressOnComplete(TColumnShard& owner, const TActorContext& ctx) = 0;

virtual bool ExecuteOnAbort(TColumnShard& owner, NTabletFlatExecutor::TTransactionContext& txc) = 0;
virtual bool CompleteOnAbort(TColumnShard& owner, const TActorContext& ctx) = 0;
Expand Down

0 comments on commit d96d33d

Please sign in to comment.