You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason behind that is because the csv reader detected the error in CsvReader::_validate_line and closed the stream load pipe in CsvReader::close first.
After that StreamLoadAction::on_chunk_data failed to append data to the pipe and set the stream load context status to <INTERNAL_ERROR] cancelled>.
Finally in StreamLoadAction::handle, since the stream load context status is not ok, it just skips waiting and return the partial & inaccurate response before instance actually finished.
voidStreamLoadAction::handle(HttpRequest* req) {
std::shared_ptr<StreamLoadContext> ctx =
std::static_pointer_cast<StreamLoadContext>(req->handler_ctx());
if (ctx == nullptr) {
return;
}
// status already set to failif (ctx->status.ok()) { *// bypassed by error status*
ctx->status = _handle(ctx);
if (!ctx->status.ok() && !ctx->status.is<PUBLISH_TIMEOUT>()) {
LOG(WARNING) << "handle streaming load failed, id=" << ctx->id
<< ", errmsg=" << ctx->status;
}
}
ctx->load_cost_millis = UnixMillis() - ctx->start_millis;
if (!ctx->status.ok() && !ctx->status.is<PUBLISH_TIMEOUT>()) {
if (ctx->need_rollback) {
_exec_env->stream_load_executor()->rollback_txn(ctx.get());
ctx->need_rollback = false;
}
if (ctx->body_sink.get() != nullptr) {
ctx->body_sink->cancel(ctx->status.to_string());
}
}
auto str = ctx->to_json();
// add new line at end
str = str + '\n';
HttpChannel::send_reply(req, str);
}
What You Expected?
stream load should return full response
How to Reproduce?
No response
Anything Else?
I have 2 potential idea for fixing:
one is to simply remove if (ctx->status.ok()) condition in StreamLoadAction::handle
// status already set to failif (ctx->status.ok()) {
ctx->status = _handle(ctx);
if (!ctx->status.ok() && !ctx->status.is<PUBLISH_TIMEOUT>()) {
LOG(WARNING) << "handle streaming load failed, id=" << ctx->id
<< ", errmsg=" << ctx->status;
}
}
another is to set stream load status before the pipe closes
Search before asking
Version
2.1.6
What's Wrong?
In case of high throughput zero error tolerance stream load with csv format input, inaccurate response could occur like:
The reason behind that is because the csv reader detected the error in
CsvReader::_validate_line
and closed the stream load pipe inCsvReader::close
first.After that
StreamLoadAction::on_chunk_data
failed to append data to the pipe and set the stream load context status to <INTERNAL_ERROR] cancelled>.Finally in
StreamLoadAction::handle
, since the stream load context status is not ok, it just skips waiting and return the partial & inaccurate response before instance actually finished.What You Expected?
stream load should return full response
How to Reproduce?
No response
Anything Else?
I have 2 potential idea for fixing:
if (ctx->status.ok())
condition inStreamLoadAction::handle
Looking forward for more opinions!
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: