Skip to content

Commit

Permalink
Reply UNAVAILABLE in case EvStartKqpTasksRequest is undelivered becau…
Browse files Browse the repository at this point in the history
…se of disconnect (ydb-platform#10435)

Co-authored-by: Ivan <5627721+abyss7@users.noreply.github.com>
  • Loading branch information
ulya-sidorina and abyss7 authored Oct 15, 2024
1 parent 951ad3b commit 1214afb
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions ydb/core/kqp/executer_actor/kqp_executer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,24 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> {
auto reason = ev->Get()->Reason;
switch (eventType) {
case TEvKqpNode::TEvStartKqpTasksRequest::EventType: {
if (reason == TEvents::TEvUndelivered::EReason::ReasonActorUnknown) {
LOG_D("Schedule a retry by ActorUnknown reason, nodeId:" << ev->Sender.NodeId() << " requestId: " << ev->Cookie);
this->Schedule(TDuration::MilliSeconds(Planner->GetCurrentRetryDelay(ev->Cookie)), new typename TEvPrivate::TEvRetry(ev->Cookie, ev->Sender));
return;
switch (reason) {
case TEvents::TEvUndelivered::EReason::ReasonActorUnknown: {
LOG_D("Schedule a retry by ActorUnknown reason, nodeId:" << ev->Sender.NodeId() << " requestId: " << ev->Cookie);
this->Schedule(TDuration::MilliSeconds(Planner->GetCurrentRetryDelay(ev->Cookie)), new typename TEvPrivate::TEvRetry(ev->Cookie, ev->Sender));
return;
}
case TEvents::TEvUndelivered::EReason::Disconnected: {
InvalidateNode(ev->Sender.NodeId());
ReplyUnavailable(TStringBuilder()
<< "Failed to send EvStartKqpTasksRequest because node is unavailable: " << ev->Sender.NodeId());
return;
}
case TEvents::TEvUndelivered::EReason::ReasonUnknown: {
InvalidateNode(ev->Sender.NodeId());
InternalError(TStringBuilder() << "TEvKqpNode::TEvStartKqpTasksRequest lost: " << reason);
return;
}
}
InvalidateNode(ev->Sender.NodeId());
return InternalError(TStringBuilder()
<< "TEvKqpNode::TEvStartKqpTasksRequest lost: " << reason);
}
default: {
LOG_E("Event lost, type: " << eventType << ", reason: " << reason);
Expand Down

0 comments on commit 1214afb

Please sign in to comment.