diff options
| author | lucius <[email protected]> | 2026-05-21 20:03:13 +0300 |
|---|---|---|
| committer | lucius <[email protected]> | 2026-05-22 14:32:42 +0300 |
| commit | c8bc3f28d057b4daebc4bdc8d831d111fb9cfcb9 (patch) | |
| tree | d2b6ab38ab25311acd951e9f580d72f822770723 | |
| parent | 722589b07a82a0f2ac670bf6ba1f6c11a3411a51 (diff) | |
fail on race only when EQueryCacheMode::Refresh was set from user
Гонки при записи в кеш в режиме refresh запрещены, но в режиме yt.QueryCacheCombineChunksReplace для некоторых операций происходит подмена normal-\>refresh и это может приводить к падениям. Этот PR делает так чтобы гонки запрещались только если юзер хотел refresh, но разрешались в технических refresh.
commit_hash:9d6d7028dd85f27d895f56befe8aa19919efe87b
| -rw-r--r-- | yt/yql/providers/yt/gateway/lib/query_cache.cpp | 3 | ||||
| -rw-r--r-- | yt/yql/providers/yt/gateway/lib/query_cache.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/yt/yql/providers/yt/gateway/lib/query_cache.cpp b/yt/yql/providers/yt/gateway/lib/query_cache.cpp index cca1c43cd86..9b27f665498 100644 --- a/yt/yql/providers/yt/gateway/lib/query_cache.cpp +++ b/yt/yql/providers/yt/gateway/lib/query_cache.cpp @@ -140,6 +140,7 @@ TYtQueryCacheItem::TYtQueryCacheItem(EQueryCacheMode mode, const TTransactionCac , LogCtx(logCtx) , MergeSpec(mergeSpec) , TableAttrs(tableAttrs) + , FailOnRace(Mode == EQueryCacheMode::Refresh && mode == EQueryCacheMode::Refresh) { if (!hash.empty()) { if (singleOutputHash) { @@ -296,7 +297,7 @@ void TYtQueryCacheItem::StoreImpl() { nestedWriteTx->Abort(); } - if (!IsRace(e) || Mode == EQueryCacheMode::Refresh) { + if (!IsRace(e) || FailOnRace) { throw; } }; diff --git a/yt/yql/providers/yt/gateway/lib/query_cache.h b/yt/yql/providers/yt/gateway/lib/query_cache.h index c8947eece6f..31cd92e6433 100644 --- a/yt/yql/providers/yt/gateway/lib/query_cache.h +++ b/yt/yql/providers/yt/gateway/lib/query_cache.h @@ -108,6 +108,7 @@ private: const NYT::TNode MergeSpec; NYT::TNode TableAttrs; NYT::ITransactionPtr LockTx; + const bool FailOnRace; }; } // NYql |
