Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed backward compatibility in fq-proxy result_writer_actor #5111

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ydb/core/fq/libs/compute/ydb/result_writer_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ class TResultSetWriterActor : public TBaseComputeActor<TResultSetWriterActor> {

void Handle(const TEvYdbCompute::TEvFetchScriptResultResponse::TPtr& ev) {
const auto& response = *ev.Get()->Get();
if (response.Status == NYdb::EStatus::BAD_REQUEST && FetchRowsLimit == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А точно bad requst только в этом случае вылетает? Не можем мы тут откатиться по другой ошибке?

Copy link
Collaborator Author

@GrigoriyPA GrigoriyPA Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можем и кажется это даже может быть хорошо, например если в результатах какие-то проблемы (например слишком длинные строчки, более 20MB) и новый вычитыватель не справился:

if (result.RowsCount() == 0) {
if (ResultSet.rows_size() > 0) {
Finish();
} else {
Finish(Ydb::StatusIds::BAD_REQUEST, "Failed to fetch script result due to size limit");
}
return;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Но такого же быть не должно. Это баг получается в этом случае. На сенсорах будем видеть такие затупы, а то можем не заметить деградаций?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сенсоров на такие затупы нету, но эта проблема должна пофикситься когда GetResult будет переписан на стримовый запрос

LOG_W("ResultSetId: " << ResultSetId << " Got bad request: " << ev->Get()->Issues.ToOneLineString() << ", try to fallback to old behaviour");
FetchRowsLimit = 1000;
SendFetchScriptResultRequest();
return;
}

if (response.Status != NYdb::EStatus::SUCCESS) {
LOG_E("ResultSetId: " << ResultSetId << " Can't fetch script result: " << ev->Get()->Issues.ToOneLineString());
Send(Parent, new TEvYdbCompute::TEvResultSetWriterResponse(ResultSetId, ev->Get()->Issues, NYdb::EStatus::INTERNAL_ERROR));
Expand Down Expand Up @@ -190,7 +197,7 @@ class TResultSetWriterActor : public TBaseComputeActor<TResultSetWriterActor> {

void SendFetchScriptResultRequest() {
LastProcessedToken = FetchToken;
Register(new TRetryActor<TEvYdbCompute::TEvFetchScriptResultRequest, TEvYdbCompute::TEvFetchScriptResultResponse, NKikimr::NOperationId::TOperationId, int64_t, TString, uint64_t>(Counters.GetCounters(ERequestType::RT_FETCH_SCRIPT_RESULT), SelfId(), Connector, OperationId, ResultSetId, FetchToken, 0));
Register(new TRetryActor<TEvYdbCompute::TEvFetchScriptResultRequest, TEvYdbCompute::TEvFetchScriptResultResponse, NKikimr::NOperationId::TOperationId, int64_t, TString, uint64_t>(Counters.GetCounters(ERequestType::RT_FETCH_SCRIPT_RESULT), SelfId(), Connector, OperationId, ResultSetId, FetchToken, FetchRowsLimit));
}

void SendReplyAndPassAway() {
Expand Down Expand Up @@ -222,6 +229,7 @@ class TResultSetWriterActor : public TBaseComputeActor<TResultSetWriterActor> {
bool Truncated = false;
TString FetchToken;
TString LastProcessedToken;
ui64 FetchRowsLimit = 0;
const size_t ProtoMessageLimit = 10_MB;
const size_t MaxRowsCountPerChunk = 100'000;
const size_t BaseProtoByteSize = CreateProtoRequestWithoutResultSet(0).ByteSizeLong();
Expand Down
Loading