This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 298a58ccc7a0db536c98cca3527460caba09b28e Author: yiguolei <676222...@qq.com> AuthorDate: Sun Jul 23 10:19:20 2023 +0800 [bugfix](scanner) when scanner init failed during get tablet, not need call update counters (#22117) Co-authored-by: yiguolei <yiguo...@gmail.com> If the scanner is failed during init or open, then not need update counters because the query is fail and the counter is useless. And it may core during update counters. For example, update counters depend on scanner's tablet, but the tablet == null when init failed. --- be/src/vec/exec/scan/vscanner.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/be/src/vec/exec/scan/vscanner.h b/be/src/vec/exec/scan/vscanner.h index 7103449940..321ee2f0d8 100644 --- a/be/src/vec/exec/scan/vscanner.h +++ b/be/src/vec/exec/scan/vscanner.h @@ -124,7 +124,13 @@ public: bool need_to_close() { return _need_to_close; } void mark_to_need_to_close() { - _update_counters_before_close(); + // If the scanner is failed during init or open, then not need update counters + // because the query is fail and the counter is useless. And it may core during + // update counters. For example, update counters depend on scanner's tablet, but + // the tablet == null when init failed. + if (_is_open) { + _update_counters_before_close(); + } _need_to_close = true; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org