From e5d95188d40f8db67ef71ea1610c70518f77d72b Mon Sep 17 00:00:00 2001 From: ivanmorozov333 Date: Tue, 24 Dec 2024 14:41:01 +0300 Subject: [PATCH] fix coredumps simple --- ydb/core/tx/columnshard/counters/writes_monitor.cpp | 6 ++++-- ydb/core/tx/columnshard/counters/writes_monitor.h | 4 ++-- ydb/core/tx/columnshard/data_reader/actor.cpp | 7 +++++++ ydb/core/tx/columnshard/data_reader/actor.h | 2 ++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ydb/core/tx/columnshard/counters/writes_monitor.cpp b/ydb/core/tx/columnshard/counters/writes_monitor.cpp index a29f0681ee0b..380b6bb719fc 100644 --- a/ydb/core/tx/columnshard/counters/writes_monitor.cpp +++ b/ydb/core/tx/columnshard/counters/writes_monitor.cpp @@ -15,14 +15,16 @@ void TWritesMonitor::OnStartWrite(const ui64 dataSize) { UpdateTabletCounters(); } -void TWritesMonitor::OnFinishWrite(const ui64 dataSize, const ui32 writesCount /*= 1*/) { +void TWritesMonitor::OnFinishWrite(const ui64 dataSize, const ui32 writesCount /*= 1*/, const bool onDestroy /*= false*/) { AFL_VERIFY(writesCount <= WritesInFlightLocal); AFL_VERIFY(dataSize <= WritesSizeInFlightLocal); WritesSizeInFlightLocal -= dataSize; WritesInFlightLocal -= writesCount; AFL_VERIFY(0 <= WritesInFlight.Sub(writesCount)); AFL_VERIFY(0 <= WritesSizeInFlight.Sub(dataSize)); - UpdateTabletCounters(); + if (!onDestroy) { + UpdateTabletCounters(); + } } TString TWritesMonitor::DebugString() const { diff --git a/ydb/core/tx/columnshard/counters/writes_monitor.h b/ydb/core/tx/columnshard/counters/writes_monitor.h index 0a7f21c5e103..d66bd010f69e 100644 --- a/ydb/core/tx/columnshard/counters/writes_monitor.h +++ b/ydb/core/tx/columnshard/counters/writes_monitor.h @@ -21,12 +21,12 @@ class TWritesMonitor: TNonCopyable { } ~TWritesMonitor() { - OnFinishWrite(WritesSizeInFlightLocal, WritesInFlightLocal); + OnFinishWrite(WritesSizeInFlightLocal, WritesInFlightLocal, true); } void OnStartWrite(const ui64 dataSize); - void OnFinishWrite(const ui64 dataSize, const ui32 writesCount = 1); + void OnFinishWrite(const ui64 dataSize, const ui32 writesCount = 1, const bool onDestroy = false); TString DebugString() const; diff --git a/ydb/core/tx/columnshard/data_reader/actor.cpp b/ydb/core/tx/columnshard/data_reader/actor.cpp index d97def756f05..32924b143395 100644 --- a/ydb/core/tx/columnshard/data_reader/actor.cpp +++ b/ydb/core/tx/columnshard/data_reader/actor.cpp @@ -59,6 +59,13 @@ void TActor::HandleExecute(NKqp::TEvKqpCompute::TEvScanError::TPtr& ev) { PassAway(); } +void TActor::HandleExecute(NActors::TEvents::TEvUndelivered::TPtr& ev) { + SwitchStage(std::nullopt, EStage::Finished); + AFL_ERROR(NKikimrServices::TX_COLUMNSHARD_RESTORE)("event", "problem_on_event_undelivered")("reason", ev->Get()->Reason); + RestoreTask->OnError("cannot delivery event: " + ::ToString(ev->Get()->Reason)); + PassAway(); +} + void TActor::HandleExecute(NActors::TEvents::TEvWakeup::TPtr& /*ev*/) { if (!CheckActivity()) { TBase::Send(*ScanActorId, new NKqp::TEvKqp::TEvAbortExecution(NYql::NDqProto::StatusIds::ABORTED, "external task aborted")); diff --git a/ydb/core/tx/columnshard/data_reader/actor.h b/ydb/core/tx/columnshard/data_reader/actor.h index e7356b87fc0b..d395aa2bc074 100644 --- a/ydb/core/tx/columnshard/data_reader/actor.h +++ b/ydb/core/tx/columnshard/data_reader/actor.h @@ -78,6 +78,7 @@ class TActor: public NActors::TActorBootstrapped { void HandleExecute(NKqp::TEvKqpCompute::TEvScanInitActor::TPtr& ev); void HandleExecute(NKqp::TEvKqpCompute::TEvScanData::TPtr& ev); void HandleExecute(NKqp::TEvKqpCompute::TEvScanError::TPtr& ev); + void HandleExecute(NActors::TEvents::TEvUndelivered::TPtr& ev); void HandleExecute(NActors::TEvents::TEvWakeup::TPtr& ev); public: @@ -95,6 +96,7 @@ class TActor: public NActors::TActorBootstrapped { hFunc(NKqp::TEvKqpCompute::TEvScanInitActor, HandleExecute); hFunc(NKqp::TEvKqpCompute::TEvScanData, HandleExecute); hFunc(NKqp::TEvKqpCompute::TEvScanError, HandleExecute); + hFunc(NActors::TEvents::TEvUndelivered, HandleExecute); hFunc(NActors::TEvents::TEvWakeup, HandleExecute); default: AFL_VERIFY(false)("type", ev->GetTypeName());