-
Notifications
You must be signed in to change notification settings - Fork 610
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
YQ-2803 Exception checking in checkpoint storages #1540
YQ-2803 Exception checking in checkpoint storages #1540
Conversation
⚪
|
⚪
|
⚪
|
⚪
|
ydb/core/fq/libs/ydb/ydb.cpp
Outdated
return StatusToIssues(future.GetValue()); | ||
} catch (...) { | ||
TIssues issues; | ||
issues.AddIssue(CurrentExceptionMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
хорошо бы разделять ошибки внутри нашей системы от ошибок внутри базы. то есть текст сообщения тут лучше все же придумать и к нему уже прибавить текст исключения
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added text "StatusToIssues failed"
return TCreateCheckpointResult(TString(), std::move(issues)); | ||
} else { | ||
return TCreateCheckpointResult(checkpointContext->CheckpointGraphDescriptionContext->GraphDescId, NYql::TIssues()); | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему бы не использовать в этих местах функцию StatusToIssues ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, used
return TCreateCheckpointResult(checkpointContext->CheckpointGraphDescriptionContext->GraphDescId, NYql::TIssues()); | ||
try { | ||
if (NYql::TIssues issues = StatusToIssues(future.GetValue())) { | ||
return TCreateCheckpointResult(TString(), std::move(issues)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if/else тут не нужны
descId = ...;
issues = StatusToIssues(...);
return TCreateCheckpointResult(descId, std::move(issues));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
⚪
|
⚪
|
|
||
return StatusToIssues(future).Apply( | ||
[result] (const TFuture<TIssues>& future) { | ||
return std::make_pair(std::move(result->Size), std::move(future.GetValue())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
везде вместо GetValue предлагают использовать ExtractValue, чтобы делался мув и не было копий
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У Apply() сигнатура должна быть ...(const TFuture&>()) (future.h), а ExtractValue не констатная. Поэтому так не получается
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тогда давай убирать бесполезные std::move. в этой строке их две штуки, как я понимаю
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убрал лишние std::move
|
||
return StatusToIssues(future).Apply( | ||
[result] (const TFuture<TIssues>& future) { | ||
return std::make_pair(std::move(result->Size), std::move(future.GetValue())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тогда давай убирать бесполезные std::move. в этой строке их две штуки, как я понимаю
ydb/core/fq/libs/ydb/ut/ydb_ut.cpp
Outdated
UNIT_ASSERT(issues.Size() == 1); | ||
UNIT_ASSERT(issues.ToString().Contains(text)); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
; лишняя
⚪
|
⚪
|
⚪
|
⚪
|
* Exception check * Add new line * remove comment * Use StatusToIssues() * remove some std::move * remove ;
Changelog entry
Changelog category
Additional information