diff options
author | snaury <snaury@ydb.tech> | 2022-08-12 18:47:47 +0300 |
---|---|---|
committer | snaury <snaury@ydb.tech> | 2022-08-12 18:47:47 +0300 |
commit | c227467c172cc1698c618a86e68ee8d15f3e26ad (patch) | |
tree | 23d6a6db1ec8a7054570e567f49431419e9ad1a9 | |
parent | 39f735a201d3e69ef5b93a64101d43d6d6e532a7 (diff) | |
download | ydb-c227467c172cc1698c618a86e68ee8d15f3e26ad.tar.gz |
Use correct mvcc mode when calculating tx version,
-rw-r--r-- | ydb/core/tx/datashard/datashard.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ydb/core/tx/datashard/datashard.cpp b/ydb/core/tx/datashard/datashard.cpp index 392b587166..19d3bd1a3c 100644 --- a/ydb/core/tx/datashard/datashard.cpp +++ b/ydb/core/tx/datashard/datashard.cpp @@ -1537,17 +1537,15 @@ TReadWriteVersions TDataShard::GetReadWriteVersions(TOperation* op) const { if (!IsMvccEnabled()) return {TRowVersion::Max(), SnapshotManager.GetMinWriteVersion()}; - if (op && op->MvccReadWriteVersion) { - return *op->MvccReadWriteVersion; - } - - auto mvccVersion = GetMvccTxVersion(EMvccTxMode::ReadWrite, op); - if (op) { - op->MvccReadWriteVersion = mvccVersion; + if (!op->MvccReadWriteVersion) { + op->MvccReadWriteVersion = GetMvccTxVersion(op->IsReadOnly() ? EMvccTxMode::ReadOnly : EMvccTxMode::ReadWrite, op); + } + + return *op->MvccReadWriteVersion; } - return mvccVersion; + return GetMvccTxVersion(EMvccTxMode::ReadWrite, nullptr); } TDataShard::TPromotePostExecuteEdges TDataShard::PromoteImmediatePostExecuteEdges( |