diff options
Diffstat (limited to 'ydb/core/kqp/common/kqp_tx.h')
-rw-r--r-- | ydb/core/kqp/common/kqp_tx.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ydb/core/kqp/common/kqp_tx.h b/ydb/core/kqp/common/kqp_tx.h index 8d324e0ae0..d7353de054 100644 --- a/ydb/core/kqp/common/kqp_tx.h +++ b/ydb/core/kqp/common/kqp_tx.h @@ -235,6 +235,7 @@ public: HasOlapTable = false; HasOltpTable = false; HasTableWrite = false; + HasTableRead = false; NeedUncommittedChangesFlush = false; } @@ -264,16 +265,24 @@ public: Readonly = true; break; + case Ydb::Table::TransactionSettings::kSnapshotReadWrite: + EffectiveIsolationLevel = NKikimrKqp::ISOLATION_LEVEL_SNAPSHOT_RW; + Readonly = false; + break; + case Ydb::Table::TransactionSettings::TX_MODE_NOT_SET: YQL_ENSURE(false, "tx_mode not set, settings: " << settings); break; }; } - bool ShouldExecuteDeferredEffects() const { + bool ShouldExecuteDeferredEffects(const TKqpPhyTxHolder::TConstPtr& tx) const { if (NeedUncommittedChangesFlush || HasOlapTable) { return !DeferredEffects.Empty(); } + if (EffectiveIsolationLevel == NKikimrKqp::ISOLATION_LEVEL_SNAPSHOT_RW && !tx && HasTableRead) { + return !DeferredEffects.Empty(); + } return false; } @@ -343,6 +352,7 @@ public: bool HasOlapTable = false; bool HasOltpTable = false; bool HasTableWrite = false; + bool HasTableRead = false; bool NeedUncommittedChangesFlush = false; THashSet<NKikimr::TTableId> ModifiedTablesSinceLastFlush; |