Skip to content

Commit

Permalink
Merge 862eeac into e9b6136
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius authored Feb 5, 2024
2 parents e9b6136 + 862eeac commit 744cd65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ydb/library/yql/providers/dq/actors/result_actor_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ namespace NYql::NDqs::NExecutionHelpers {
}

WriteQueue.emplace(std::move(data), messageId);
InflightBytes += WriteQueue.back().Size;
if (FullResultTableEnabled && FullResultWriterID) {
TryWriteToFullResultTable();
} else {
Expand Down Expand Up @@ -214,6 +215,7 @@ namespace NYql::NDqs::NExecutionHelpers {
} else {
WaitingAckFromFRW = false;
WriteQueue.clear();
InflightBytes = 0;
Y_ABORT_UNLESS(ev->Get()->Record.GetStatusCode() != NYql::NDqProto::StatusIds::SUCCESS);
TBase::Send(ExecuterID, ev->Release().Release());
}
Expand All @@ -234,6 +236,7 @@ namespace NYql::NDqs::NExecutionHelpers {
if (!WriteQueue.front().SentProcessedEvent) { // messages, received before limits exceeded, are already been reported
TBase::Send(TBase::SelfId(), MakeHolder<TEvMessageProcessed>(WriteQueue.front().MessageId));
}
InflightBytes -= WriteQueue.back().Size;
WriteQueue.pop();

if (WriteQueue.empty()) {
Expand Down Expand Up @@ -356,6 +359,7 @@ namespace NYql::NDqs::NExecutionHelpers {
, MessageId(messageId)
, SentProcessedEvent(false)
, IsFinal(false)
, Size(Data.Size())
{
}

Expand All @@ -370,6 +374,7 @@ namespace NYql::NDqs::NExecutionHelpers {
const TString MessageId;
bool SentProcessedEvent = false;
bool IsFinal = false;
ui64 Size = 0;
};

protected:
Expand All @@ -378,6 +383,7 @@ namespace NYql::NDqs::NExecutionHelpers {
TDqConfiguration::TPtr Settings;
bool FinishCalled;
bool EarlyFinish;
ui64 InflightBytes = 0;

private:
const bool FullResultTableEnabled;
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/yql/providers/dq/actors/result_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TResultReceiver: public NYql::NDqs::NExecutionHelpers::TResultActorBase<TR
auto req = MakeHolder<NDq::TEvDqCompute::TEvChannelDataAck>();
req->Record.SetChannelId(message->Get()->Record.GetChannelData().GetChannelId());
req->Record.SetSeqNo(message->Get()->Record.GetSeqNo());
req->Record.SetFreeSpace(256_MB);
req->Record.SetFreeSpace(256_MB - InflightBytes);
req->Record.SetFinish(EarlyFinish); // set if premature finish started (when response limit reached and FullResultTable not enabled)

Send(message->Sender, req.Release());
Expand Down

0 comments on commit 744cd65

Please sign in to comment.