diff options
author | chertus <azuikov@ydb.tech> | 2023-01-10 12:40:02 +0300 |
---|---|---|
committer | chertus <azuikov@ydb.tech> | 2023-01-10 12:40:02 +0300 |
commit | fd0193e834ffea41a37811faad606672fe8707cd (patch) | |
tree | 2fdb0a779164ef71bd024a5cbdeb29466c00f877 | |
parent | 4c8400526beadeb0d8ebe794a1869605de5c99f2 (diff) | |
download | ydb-fd0193e834ffea41a37811faad606672fe8707cd.tar.gz |
fix data loss in compaction
-rw-r--r-- | ydb/core/tx/columnshard/columnshard__write_index.cpp | 4 | ||||
-rw-r--r-- | ydb/core/tx/columnshard/compaction_actor.cpp | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/ydb/core/tx/columnshard/columnshard__write_index.cpp b/ydb/core/tx/columnshard/columnshard__write_index.cpp index 7d5a298107e..109507625b7 100644 --- a/ydb/core/tx/columnshard/columnshard__write_index.cpp +++ b/ydb/core/tx/columnshard/columnshard__write_index.cpp @@ -315,10 +315,6 @@ void TTxWriteIndex::Complete(const TActorContext& ctx) { void TColumnShard::Handle(TEvPrivate::TEvWriteIndex::TPtr& ev, const TActorContext& ctx) { auto& blobs = ev->Get()->Blobs; - bool isCompaction = ev->Get()->GranuleCompaction; - if (isCompaction && blobs.empty()) { - ev->Get()->PutStatus = NKikimrProto::OK; - } if (ev->Get()->PutStatus == NKikimrProto::UNKNOWN) { if (IsAnyChannelYellowStop()) { diff --git a/ydb/core/tx/columnshard/compaction_actor.cpp b/ydb/core/tx/columnshard/compaction_actor.cpp index 179f10a7b39..1b5d26ff400 100644 --- a/ydb/core/tx/columnshard/compaction_actor.cpp +++ b/ydb/core/tx/columnshard/compaction_actor.cpp @@ -131,6 +131,9 @@ private: TxEvent->IndexChanges->SetBlobs(std::move(Blobs)); TxEvent->Blobs = NOlap::TColumnEngineForLogs::CompactBlobs(TxEvent->IndexInfo, TxEvent->IndexChanges); + if (TxEvent->Blobs.empty()) { + TxEvent->PutStatus = NKikimrProto::OK; // nothing to write, commit + } } TxEvent->Duration = TAppData::TimeProvider->Now() - LastActivationTime; ui32 blobsSize = TxEvent->Blobs.size(); |