-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](partial update) duplicate key occur when BE restart after conflict concurrent partial update #35739
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
Merged
dataroaring
merged 1 commit into
apache:master
from
zhannngchen:fix-partial-update-dup-key_master
Jun 1, 2024
Merged
[fix](partial update) duplicate key occur when BE restart after conflict concurrent partial update #35739
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1114,7 +1114,7 @@ void BaseTablet::_remove_sentinel_mark_from_delete_bitmap(DeleteBitmapPtr delete | |
| } | ||
| } | ||
|
|
||
| Status BaseTablet::update_delete_bitmap(const BaseTabletSPtr& self, const TabletTxnInfo* txn_info, | ||
| Status BaseTablet::update_delete_bitmap(const BaseTabletSPtr& self, TabletTxnInfo* txn_info, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: function 'update_delete_bitmap' exceeds recommended size/complexity thresholds [readability-function-size] Status BaseTablet::update_delete_bitmap(const BaseTabletSPtr& self, TabletTxnInfo* txn_info,
^Additional contextbe/src/olap/base_tablet.cpp:1116: 117 lines including whitespace and comments (threshold 80) Status BaseTablet::update_delete_bitmap(const BaseTabletSPtr& self, TabletTxnInfo* txn_info,
^ |
||
| int64_t txn_id, int64_t txn_expiration) { | ||
| SCOPED_BVAR_LATENCY(g_tablet_update_delete_bitmap_latency); | ||
| RowsetIdUnorderedSet cur_rowset_ids; | ||
|
|
@@ -1222,6 +1222,8 @@ Status BaseTablet::update_delete_bitmap(const BaseTabletSPtr& self, const Tablet | |
| RowsetSharedPtr transient_rowset; | ||
| RETURN_IF_ERROR(transient_rs_writer->build(transient_rowset)); | ||
| rowset->rowset_meta()->merge_rowset_meta(*transient_rowset->rowset_meta()); | ||
| // update the shared_ptr to new bitmap, which is consistent with current rowset. | ||
| txn_info->delete_bitmap = delete_bitmap; | ||
|
|
||
| // erase segment cache cause we will add a segment to rowset | ||
| SegmentLoader::instance()->erase_segments(rowset->rowset_id(), rowset->num_segments()); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
warning: function 'update_delete_bitmap' has cognitive complexity of 58 (threshold 50) [readability-function-cognitive-complexity]
Additional context
be/src/olap/base_tablet.cpp:1127: +1, including nesting penalty of 0, nesting level increased to 1
if (txn_info->partial_update_info && txn_info->partial_update_info->is_partial_update) { ^be/src/olap/base_tablet.cpp:1127: +1
if (txn_info->partial_update_info && txn_info->partial_update_info->is_partial_update) { ^be/src/olap/base_tablet.cpp:1128: nesting level increased to 2
transient_rs_writer = DORIS_TRY(self->create_transient_rowset_writer( ^be/src/common/status.h:694: expanded from macro 'DORIS_TRY'
({ \ ^be/src/olap/base_tablet.cpp:1128: +3, including nesting penalty of 2, nesting level increased to 3
transient_rs_writer = DORIS_TRY(self->create_transient_rowset_writer( ^be/src/common/status.h:697: expanded from macro 'DORIS_TRY'
if (!res.has_value()) [[unlikely]] { \ ^be/src/olap/base_tablet.cpp:1140: +1, including nesting penalty of 0, nesting level increased to 1
RETURN_IF_ERROR(std::dynamic_pointer_cast<BetaRowset>(rowset)->load_segments(&segments)); ^be/src/common/status.h:612: expanded from macro 'RETURN_IF_ERROR'
do { \ ^be/src/olap/base_tablet.cpp:1140: +2, including nesting penalty of 1, nesting level increased to 2
RETURN_IF_ERROR(std::dynamic_pointer_cast<BetaRowset>(rowset)->load_segments(&segments)); ^be/src/common/status.h:614: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \ ^be/src/olap/base_tablet.cpp:1146: +1, including nesting penalty of 0, nesting level increased to 1
be/src/olap/base_tablet.cpp:1151: +1, including nesting penalty of 0, nesting level increased to 1
be/src/common/status.h:612: expanded from macro 'RETURN_IF_ERROR'
do { \ ^be/src/olap/base_tablet.cpp:1151: +2, including nesting penalty of 1, nesting level increased to 2
be/src/common/status.h:614: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \ ^be/src/olap/base_tablet.cpp:1170: +1, including nesting penalty of 0, nesting level increased to 1
be/src/olap/base_tablet.cpp:1171: +2, including nesting penalty of 1, nesting level increased to 2
RETURN_IF_ERROR(calc_delete_bitmap(self, rowset, segments, specified_rowsets, delete_bitmap, ^be/src/common/status.h:612: expanded from macro 'RETURN_IF_ERROR'
do { \ ^be/src/olap/base_tablet.cpp:1171: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(calc_delete_bitmap(self, rowset, segments, specified_rowsets, delete_bitmap, ^be/src/common/status.h:614: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \ ^be/src/olap/base_tablet.cpp:1174: +1, nesting level increased to 1
} else { ^be/src/olap/base_tablet.cpp:1176: +2, including nesting penalty of 1, nesting level increased to 2
RETURN_IF_ERROR(calc_delete_bitmap(self, rowset, segments, specified_rowsets, delete_bitmap, ^be/src/common/status.h:612: expanded from macro 'RETURN_IF_ERROR'
do { \ ^be/src/olap/base_tablet.cpp:1176: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(calc_delete_bitmap(self, rowset, segments, specified_rowsets, delete_bitmap, ^be/src/common/status.h:614: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \ ^be/src/olap/base_tablet.cpp:1179: +2, including nesting penalty of 1, nesting level increased to 2
be/src/common/status.h:612: expanded from macro 'RETURN_IF_ERROR'
do { \ ^be/src/olap/base_tablet.cpp:1179: +3, including nesting penalty of 2, nesting level increased to 3
be/src/common/status.h:614: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \ ^be/src/olap/base_tablet.cpp:1183: +1, including nesting penalty of 0, nesting level increased to 1
be/src/olap/base_tablet.cpp:1185: +1, nesting level increased to 1
} else { ^be/src/olap/base_tablet.cpp:1193: nesting level increased to 1
be/src/olap/base_tablet.cpp:1200: +1, including nesting penalty of 0, nesting level increased to 1
be/src/olap/base_tablet.cpp:1200: +1
be/src/olap/base_tablet.cpp:1205: +2, including nesting penalty of 1, nesting level increased to 2
if (!st.ok()) { ^be/src/olap/base_tablet.cpp:1210: +1, including nesting penalty of 0, nesting level increased to 1
if (transient_rs_writer) { ^be/src/olap/base_tablet.cpp:1211: +2, including nesting penalty of 1, nesting level increased to 2
be/src/util/debug_points.h:36: expanded from macro 'DBUG_EXECUTE_IF'
if (UNLIKELY(config::enable_debug_points)) { \ ^be/src/olap/base_tablet.cpp:1211: +3, including nesting penalty of 2, nesting level increased to 3
be/src/util/debug_points.h:38: expanded from macro 'DBUG_EXECUTE_IF'
if (dp) { \ ^be/src/olap/base_tablet.cpp:1212: +4, including nesting penalty of 3, nesting level increased to 4
be/src/olap/base_tablet.cpp:1220: +2, including nesting penalty of 1, nesting level increased to 2
be/src/common/status.h:612: expanded from macro 'RETURN_IF_ERROR'
do { \ ^be/src/olap/base_tablet.cpp:1220: +3, including nesting penalty of 2, nesting level increased to 3
be/src/common/status.h:614: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \ ^be/src/olap/base_tablet.cpp:1222: +2, including nesting penalty of 1, nesting level increased to 2
be/src/common/status.h:612: expanded from macro 'RETURN_IF_ERROR'
do { \ ^be/src/olap/base_tablet.cpp:1222: +3, including nesting penalty of 2, nesting level increased to 3
be/src/common/status.h:614: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \ ^be/src/olap/base_tablet.cpp:1231: +1, including nesting penalty of 0, nesting level increased to 1
be/src/common/status.h:612: expanded from macro 'RETURN_IF_ERROR'
do { \ ^be/src/olap/base_tablet.cpp:1231: +2, including nesting penalty of 1, nesting level increased to 2
be/src/common/status.h:614: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \ ^