summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchertus <[email protected]>2023-02-06 17:35:27 +0300
committerchertus <[email protected]>2023-02-06 17:35:27 +0300
commit7311c32e97bf999d948b40d90d320089fd350112 (patch)
tree2596da78dbc6ff71a2d1647cd2febcfbe00fd16c
parentaf5335d3dabf1bcf2f7a9abf3dfa5106c7b7fb80 (diff)
fix eviction triggered by pure TTL
-rw-r--r--ydb/core/tx/columnshard/engines/column_engine_logs.cpp2
-rw-r--r--ydb/core/tx/columnshard/engines/tier_info.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp
index 1350f74b9b7..a53c9f92b8c 100644
--- a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp
+++ b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp
@@ -827,7 +827,7 @@ std::shared_ptr<TColumnEngineChanges> TColumnEngineForLogs::StartTtl(const THash
if (auto max = info.MaxValue(ttlColumnId)) {
bool keep = NArrow::ScalarLess(expireTimestamp, max);
- if (keep && allowEviction) {
+ if (keep && allowEviction && ttl.HasTiers()) {
TString tierName;
for (auto& tierRef : ttl.OrderedTiers) { // TODO: lower/upper_bound + move into TEviction
auto& tierInfo = tierRef.Get();
diff --git a/ydb/core/tx/columnshard/engines/tier_info.h b/ydb/core/tx/columnshard/engines/tier_info.h
index 92ffa8d6607..79e9153409a 100644
--- a/ydb/core/tx/columnshard/engines/tier_info.h
+++ b/ydb/core/tx/columnshard/engines/tier_info.h
@@ -107,12 +107,12 @@ struct TTiering {
TSet<TTierRef> OrderedTiers; // Tiers ordered by border
std::shared_ptr<TTierInfo> Ttl;
- bool Empty() const {
- return OrderedTiers.empty();
+ bool HasTiers() const {
+ return !OrderedTiers.empty();
}
void Add(const std::shared_ptr<TTierInfo>& tier) {
- if (!Empty()) {
+ if (HasTiers()) {
// TODO: support different ttl columns
Y_VERIFY(tier->EvictColumnName == OrderedTiers.begin()->Get().EvictColumnName);
}