aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnaury <snaury@ydb.tech>2022-08-12 18:47:47 +0300
committersnaury <snaury@ydb.tech>2022-08-12 18:47:47 +0300
commitc227467c172cc1698c618a86e68ee8d15f3e26ad (patch)
tree23d6a6db1ec8a7054570e567f49431419e9ad1a9
parent39f735a201d3e69ef5b93a64101d43d6d6e532a7 (diff)
downloadydb-c227467c172cc1698c618a86e68ee8d15f3e26ad.tar.gz
Use correct mvcc mode when calculating tx version,
-rw-r--r--ydb/core/tx/datashard/datashard.cpp14
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(