-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BugFix] Fix duplicate entries in be_logs; Add reset_delvec in script; Add BE id in error message when query failed #51204
[BugFix] Fix duplicate entries in be_logs; Add reset_delvec in script; Add BE id in error message when query failed #51204
Conversation
@@ -553,6 +566,7 @@ class StorageEngineRef { | |||
REG_STATIC_METHOD(StorageEngineRef, get_tablet_info); | |||
REG_STATIC_METHOD(StorageEngineRef, get_tablet_infos); | |||
REG_STATIC_METHOD(StorageEngineRef, get_tablet_meta_json); | |||
REG_STATIC_METHOD(StorageEngineRef, reset_delvec); | |||
REG_STATIC_METHOD(StorageEngineRef, get_tablet); | |||
REG_STATIC_METHOD(StorageEngineRef, drop_tablet); | |||
REG_STATIC_METHOD(StorageEngineRef, get_data_dirs); |
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.
The most risky bug in this code is:
Potential null pointer dereference in reset_delvec
method when tablet->data_dir()
returns null. This could cause a segmentation fault.
You can modify the code like this:
static std::string reset_delvec(int64_t tablet_id, int64_t segment_id, int64_t version) {
auto tablet = get_tablet(tablet_id);
if (!tablet) {
return "tablet not found";
}
auto data_dir = tablet->data_dir();
if (!data_dir) {
return "data directory not found";
}
DelVector dv;
dv.init(version, nullptr, 0);
auto st = TabletMetaManager::set_del_vector(data_dir->get_meta(), tablet_id, segment_id, dv);
return st.to_string();
}
4756897
to
ff08798
Compare
ff08798
to
6ec4e42
Compare
6ec4e42
to
a22628a
Compare
…; Add BE id in error message when query failed Signed-off-by: Binglin Chang <[email protected]>
a22628a
to
fb23b0e
Compare
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 25 / 28 (89.29%) file detail
|
@Mergifyio backport branch-3.3 |
✅ Backports have been created
|
✅ Backports have been created
|
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9) # Conflicts: # be/src/common/greplog.cpp # be/src/service/backend_options.h # be/test/storage/tablet_updates_test.cpp # test/sql/test_array_fn/R/test_array_sortby # test/sql/test_dict_mapping_function/R/test_dict_mapping_function # test/sql/test_dictionary/R/test_dictionary # test/sql/test_external_file/R/test_orc_predicates # test/sql/test_group_execution/R/test_group_execution_join # test/sql/test_inverted_index/R/test_inverted_index # test/sql/test_json/R/to_json # test/sql/test_string_functions/R/test_string_functions
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9)
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9) # Conflicts: # be/src/service/backend_options.h # test/sql/test_array_fn/R/test_array_sortby # test/sql/test_dictionary/R/test_dictionary # test/sql/test_external_file/R/test_orc_predicates # test/sql/test_group_execution/R/test_group_execution_join # test/sql/test_inverted_index/R/test_inverted_index # test/sql/test_json/R/to_json # test/sql/test_string_functions/R/test_string_functions
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9) # Conflicts: # be/src/common/greplog.cpp # be/src/exec/pipeline/pipeline_driver_executor.cpp # be/src/script/script.cpp # be/src/service/backend_options.h # be/src/service/service_be/starrocks_be.cpp # be/test/storage/tablet_updates_test.cpp # test/sql/test_array_fn/R/test_array_fn # test/sql/test_array_fn/R/test_array_sortby # test/sql/test_decimal/R/test_decimal_overflow # test/sql/test_dict_mapping_function/R/test_dict_mapping_function # test/sql/test_dictionary/R/test_dictionary # test/sql/test_external_file/R/test_orc_predicates # test/sql/test_function/R/test_time_slice # test/sql/test_generate_series/R/test_generate_series # test/sql/test_group_execution/R/test_group_execution_join # test/sql/test_inverted_index/R/test_inverted_index # test/sql/test_json/R/to_json # test/sql/test_string_functions/R/test_string_functions # test/sql/test_trino_dialect/R/test_trino_dialect # test/sql/test_udf/R/test_jvm_udf
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9) # Conflicts: # be/src/common/greplog.cpp # be/src/script/script.cpp # be/src/service/backend_options.h # be/src/service/service_be/starrocks_be.cpp # be/test/storage/tablet_updates_test.cpp # test/sql/test_array_fn/R/test_array_fn # test/sql/test_array_fn/R/test_array_sortby # test/sql/test_decimal/R/test_decimal_overflow # test/sql/test_dict_mapping_function/R/test_dict_mapping_function # test/sql/test_dictionary/R/test_dictionary # test/sql/test_external_file/R/test_orc_predicates # test/sql/test_function/R/test_time_slice # test/sql/test_generate_series/R/test_generate_series # test/sql/test_group_execution/R/test_group_execution_join # test/sql/test_inverted_index/R/test_inverted_index # test/sql/test_json/R/to_json # test/sql/test_string_functions/R/test_string_functions # test/sql/test_trino_dialect/R/test_trino_dialect # test/sql/test_udf/R/test_jvm_udf
…; Add BE id in error message when query failed (backport #51204) (#51347) Co-authored-by: Binglin Chang <[email protected]>
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9)
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9)
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9)
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9)
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9)
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9)
…; Add BE id in error message when query failed (backport #51204) (#51348) Co-authored-by: Binglin Chang <[email protected]>
…; Add BE id in error message when query failed (backport #51204) (#51350) Co-authored-by: Binglin Chang <[email protected]>
…; Add BE id in error message when query failed (backport #51204) (#51349) Co-authored-by: Binglin Chang <[email protected]>
…; Add BE id in error message when query failed (#51204) Signed-off-by: Binglin Chang <[email protected]> (cherry picked from commit 52c55f9)
…; Add BE id in error message when query failed (backport #51204) (#51351) Co-authored-by: Binglin Chang <[email protected]>
…; Add BE id in error message when query failed (StarRocks#51204) Signed-off-by: Binglin Chang <[email protected]> Signed-off-by: zhiminr.ren <[email protected]>
Why I'm doing:
Their are duplicate entries when using be_logs with '.*' parttern.
There is no be ID in error message when query failed.
What I'm doing:
Fix regex match bug in greplog;
Add BE id in error message;
Add a tool to fix corrupted metadata causing "no delete vector found" error;
Fixes #51190
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: