|
12 | 12 | #include "util_fmt_abort.h"
|
13 | 13 |
|
14 | 14 | #include <ydb/library/yverify_stream/yverify_stream.h>
|
| 15 | +#include <ydb/core/base/appdata_fwd.h> |
| 16 | +#include <ydb/core/base/feature_flags.h> |
15 | 17 |
|
16 | 18 | namespace NKikimr {
|
17 | 19 | namespace NTable {
|
@@ -1070,7 +1072,11 @@ TAutoPtr<TTableIter> TTable::Iterate(TRawVals key_, TTagsRef tags, IPages* env,
|
1070 | 1072 | }
|
1071 | 1073 |
|
1072 | 1074 | if (EraseCacheEnabled && (!RollbackState || !RollbackState->DisableEraseCache)) {
|
1073 |
| - if (!ErasedKeysCache) { |
| 1075 | + if (HasAppData() && AppData()->FeatureFlags.GetDisableLocalDBEraseCache()) { |
| 1076 | + // Note: it's not very clean adding dependency to appdata here, but |
| 1077 | + // we want to allow disabling erase cache at runtime without alters. |
| 1078 | + ErasedKeysCache.Reset(); |
| 1079 | + } else if (!ErasedKeysCache) { |
1074 | 1080 | ErasedKeysCache = new TKeyRangeCache(*Scheme->Keys, EraseCacheConfig, EraseCacheGCList);
|
1075 | 1081 | }
|
1076 | 1082 | dbIter->ErasedKeysCache = ErasedKeysCache;
|
@@ -1118,7 +1124,11 @@ TAutoPtr<TTableReverseIter> TTable::IterateReverse(TRawVals key_, TTagsRef tags,
|
1118 | 1124 | }
|
1119 | 1125 |
|
1120 | 1126 | if (EraseCacheEnabled && (!RollbackState || !RollbackState->DisableEraseCache)) {
|
1121 |
| - if (!ErasedKeysCache) { |
| 1127 | + if (HasAppData() && AppData()->FeatureFlags.GetDisableLocalDBEraseCache()) { |
| 1128 | + // Note: it's not very clean adding dependency to appdata here, but |
| 1129 | + // we want to allow disabling erase cache at runtime without alters. |
| 1130 | + ErasedKeysCache.Reset(); |
| 1131 | + } else if (!ErasedKeysCache) { |
1122 | 1132 | ErasedKeysCache = new TKeyRangeCache(*Scheme->Keys, EraseCacheConfig, EraseCacheGCList);
|
1123 | 1133 | }
|
1124 | 1134 | dbIter->ErasedKeysCache = ErasedKeysCache;
|
|
0 commit comments