Skip to content

Commit

Permalink
fix coredumps simple (ydb-platform#12914)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored and zverevgeny committed Jan 5, 2025
1 parent b3f1152 commit c8ee433
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ydb/core/tx/columnshard/counters/writes_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/columnshard/counters/writes_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 7 additions & 0 deletions ydb/core/tx/columnshard/data_reader/actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
2 changes: 2 additions & 0 deletions ydb/core/tx/columnshard/data_reader/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class TActor: public NActors::TActorBootstrapped<TActor> {
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:
Expand All @@ -95,6 +96,7 @@ class TActor: public NActors::TActorBootstrapped<TActor> {
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());
Expand Down

0 comments on commit c8ee433

Please sign in to comment.