diff options
author | ilnaz <ilnaz@ydb.tech> | 2023-10-02 19:07:26 +0300 |
---|---|---|
committer | ilnaz <ilnaz@ydb.tech> | 2023-10-02 20:13:49 +0300 |
commit | 03831fe1d711fbe06fe59d9921f16b37260dc69d (patch) | |
tree | 19dc795bb79ea1ba1b62fd96398ca2e77376c466 | |
parent | 50fcf535f7e8fb0c1660d743c46a4e79500f326d (diff) | |
download | ydb-03831fe1d711fbe06fe59d9921f16b37260dc69d.tar.gz |
Fix uninitialized SnapshotTime KIKIMR-19504
-rw-r--r-- | ydb/core/tx/schemeshard/schemeshard__operation_backup_restore_common.h | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_backup_restore_common.h b/ydb/core/tx/schemeshard/schemeshard__operation_backup_restore_common.h index e031beab2e..fca71cbc87 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_backup_restore_common.h +++ b/ydb/core/tx/schemeshard/schemeshard__operation_backup_restore_common.h @@ -3,7 +3,6 @@ #include "schemeshard__operation_common.h" #include "schemeshard_billing_helpers.h" #include "schemeshard_impl.h" -#include "schemeshard_path_describer.h" #include "schemeshard_types.h" #include <ydb/core/base/subdomain.h> @@ -17,7 +16,6 @@ template <typename TKind> class TConfigurePart: public TSubOperationState { const TTxState::ETxType TxType; const TOperationId OperationId; - const TVirtualTimestamp SnapshotTime; TString DebugHint() const override { return TStringBuilder() @@ -25,11 +23,16 @@ class TConfigurePart: public TSubOperationState { << ", opId: " << OperationId; } + static TVirtualTimestamp GetSnapshotTime(const TSchemeShard* ss, const TPathId& pathId) { + Y_VERIFY(ss->PathsById.contains(pathId)); + TPathElement::TPtr path = ss->PathsById.at(pathId); + return TVirtualTimestamp(path->StepCreated, path->CreateTxId); + } + public: - TConfigurePart(TTxState::ETxType type, TOperationId id, TVirtualTimestamp snapshotTime) + TConfigurePart(TTxState::ETxType type, TOperationId id) : TxType(type) , OperationId(id) - , SnapshotTime(snapshotTime) { IgnoreMessages(DebugHint(), {}); } @@ -60,7 +63,7 @@ public: txState->ClearShardsInProgress(); if constexpr (TKind::NeedSnapshotTime()) { - TKind::ProposeTx(OperationId, *txState, context, SnapshotTime); + TKind::ProposeTx(OperationId, *txState, context, GetSnapshotTime(context.SS, txState->TargetPathId)); } else { TKind::ProposeTx(OperationId, *txState, context); } @@ -452,7 +455,6 @@ template <typename TKind, typename TEvCancel> class TBackupRestoreOperationBase: public TSubOperation { const TTxState::ETxType TxType; const TPathElement::EPathState Lock; - TVirtualTimestamp SnapshotTime; static TTxState::ETxState NextState() { return TTxState::CreateParts; @@ -499,7 +501,7 @@ class TBackupRestoreOperationBase: public TSubOperation { case TTxState::CreateParts: return MakeHolder<TCreateParts>(OperationId); case TTxState::ConfigureParts: - return MakeHolder<TConfigurePart<TKind>>(TxType, OperationId, SnapshotTime); + return MakeHolder<TConfigurePart<TKind>>(TxType, OperationId); case TTxState::Propose: return MakeHolder<TPropose<TKind>>(TxType, OperationId); case TTxState::ProposedWaitParts: @@ -636,13 +638,6 @@ public: return result; } - if constexpr (TKind::NeedSnapshotTime()) { - TPathElement::TPtr targetPath = context.SS->PathsById.at(path.Base()->PathId); - - SnapshotTime.SetStep(targetPath->StepCreated); - SnapshotTime.SetTxId(targetPath->CreateTxId); - } - PrepareChanges(path.Base(), context); SetState(NextState()); |