aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchertus <azuikov@ydb.tech>2023-02-20 13:58:49 +0300
committerchertus <azuikov@ydb.tech>2023-02-20 13:58:49 +0300
commitc3d5b651bb091783c1f78c74bb8c926b61a7f3a4 (patch)
tree45cdefe5bc4aae0f3c668d620dac6aedbfbef057
parent631094142a5d76e135d6016c72a218be08277a46 (diff)
downloadydb-c3d5b651bb091783c1f78c74bb8c926b61a7f3a4.tar.gz
fix export: disable export with recompression (not implemented)
-rw-r--r--ydb/core/tx/columnshard/columnshard__write_index.cpp3
-rw-r--r--ydb/core/tx/columnshard/engines/column_engine.h4
-rw-r--r--ydb/core/tx/columnshard/engines/column_engine_logs.cpp6
-rw-r--r--ydb/core/tx/columnshard/engines/index_info.cpp4
-rw-r--r--ydb/core/tx/columnshard/engines/tier_info.h10
-rw-r--r--ydb/core/tx/tiering/manager.cpp1
6 files changed, 24 insertions, 4 deletions
diff --git a/ydb/core/tx/columnshard/columnshard__write_index.cpp b/ydb/core/tx/columnshard/columnshard__write_index.cpp
index d82680e73c3..664a6d434e4 100644
--- a/ydb/core/tx/columnshard/columnshard__write_index.cpp
+++ b/ydb/core/tx/columnshard/columnshard__write_index.cpp
@@ -139,8 +139,7 @@ bool TTxWriteIndex::Execute(TTransactionContext& txc, const TActorContext& ctx)
}
// Mark exported blobs
- auto& tManager = Self->GetTierManagerVerified(tierName);
- if (tManager.NeedExport()) {
+ if (evictionFeatures.NeedExport) {
for (auto& rec : portionInfo.Records) {
auto& blobId = rec.BlobRange.BlobId;
if (!blobsToExport.count(blobId)) {
diff --git a/ydb/core/tx/columnshard/engines/column_engine.h b/ydb/core/tx/columnshard/engines/column_engine.h
index 0eb9ce45b4a..b321e0d70a6 100644
--- a/ydb/core/tx/columnshard/engines/column_engine.h
+++ b/ydb/core/tx/columnshard/engines/column_engine.h
@@ -64,11 +64,13 @@ struct TCompactionInfo {
struct TPortionEvictionFeatures {
const TString TargetTierName;
const ui64 PathId; // portion path id for cold-storage-key construct
+ bool NeedExport = false;
bool DataChanges = true;
- TPortionEvictionFeatures(const TString& targetTierName, const ui64 pathId)
+ TPortionEvictionFeatures(const TString& targetTierName, const ui64 pathId, bool needExport)
: TargetTierName(targetTierName)
, PathId(pathId)
+ , NeedExport(needExport)
{}
};
diff --git a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp
index 7e732689d09..4eae943915e 100644
--- a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp
+++ b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp
@@ -78,6 +78,8 @@ bool UpdateEvictedPortion(TPortionInfo& portionInfo, const TIndexInfo& indexInfo
return true;
}
+ Y_VERIFY(!evictFeatures.NeedExport);
+
auto schema = indexInfo.ArrowSchemaWithSpecials();
auto batch = portionInfo.AssembleInBatch(indexInfo, schema, srcBlobs);
auto writeOptions = WriteOptions(*compression);
@@ -851,7 +853,9 @@ std::shared_ptr<TColumnEngineChanges> TColumnEngineForLogs::StartTtl(const THash
}
if (info.TierName != tierName) {
evicttionSize += info.BlobsSizes().first;
- changes->PortionsToEvict.emplace_back(info, TPortionEvictionFeatures(tierName, pathId));
+ bool needExport = ttl.NeedExport(tierName);
+ changes->PortionsToEvict.emplace_back(
+ info, TPortionEvictionFeatures(tierName, pathId, needExport));
}
}
if (!keep && allowDrop) {
diff --git a/ydb/core/tx/columnshard/engines/index_info.cpp b/ydb/core/tx/columnshard/engines/index_info.cpp
index 37ce40d1ea0..187ad5d0f7b 100644
--- a/ydb/core/tx/columnshard/engines/index_info.cpp
+++ b/ydb/core/tx/columnshard/engines/index_info.cpp
@@ -265,6 +265,10 @@ void TIndexInfo::UpdatePathTiering(THashMap<ui64, NOlap::TTiering>& pathTiering)
if (!tierInfo->EvictColumn) {
tierInfo->EvictColumn = schema->GetFieldByName(tierInfo->EvictColumnName);
}
+ // TODO: eviction with recompression is not supported yet
+ if (tierInfo->NeedExport) {
+ tierInfo->Compression = {};
+ }
}
if (tiering.Ttl && !tiering.Ttl->EvictColumn) {
tiering.Ttl->EvictColumn = schema->GetFieldByName(tiering.Ttl->EvictColumnName);
diff --git a/ydb/core/tx/columnshard/engines/tier_info.h b/ydb/core/tx/columnshard/engines/tier_info.h
index 79e9153409a..61c8093e8b8 100644
--- a/ydb/core/tx/columnshard/engines/tier_info.h
+++ b/ydb/core/tx/columnshard/engines/tier_info.h
@@ -16,6 +16,7 @@ struct TTierInfo {
std::shared_ptr<arrow::Field> EvictColumn;
std::optional<TCompression> Compression;
ui32 TtlUnitsInSecond;
+ bool NeedExport = false;
TTierInfo(const TString& tierName, TInstant evictBorder, const TString& column, ui32 unitsInSecond = 0)
: Name(tierName)
@@ -148,6 +149,15 @@ struct TTiering {
return {};
}
+ bool NeedExport(const TString& name) const {
+ auto it = TierByName.find(name);
+ if (it != TierByName.end()) {
+ Y_VERIFY(!name.empty());
+ return it->second->NeedExport;
+ }
+ return false;
+ }
+
THashSet<TString> GetTtlColumns() const {
THashSet<TString> out;
if (Ttl) {
diff --git a/ydb/core/tx/tiering/manager.cpp b/ydb/core/tx/tiering/manager.cpp
index a64afc84e13..ed9c4b8c94e 100644
--- a/ydb/core/tx/tiering/manager.cpp
+++ b/ydb/core/tx/tiering/manager.cpp
@@ -229,6 +229,7 @@ THashMap<ui64, NKikimr::NOlap::TTiering> TTiersManager::GetTiering() const {
auto it = tierConfigs.find(name);
if (it != tierConfigs.end()) {
tier->Compression = NTiers::ConvertCompression(it->second.GetCompression());
+ tier->NeedExport = it->second.NeedExport();
}
}
}