This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 99dbc0f3db4 [fix](compaction) fix inaccurate compaction cnt (#35539)
99dbc0f3db4 is described below
commit 99dbc0f3db481ac56ff76c739ba9691babb06f4d
Author: Luwei <[email protected]>
AuthorDate: Wed May 29 09:35:35 2024 +0800
[fix](compaction) fix inaccurate compaction cnt (#35539)
## bug
Before this bug is fixed, when the rpc of commit compaction job and the
rpc of sync tablet meta are parallel and out of order, the compaction
cnt may be inaccurate.
for example
1 cumu_compaction_cnt = 10
2 meta service, commit compaction job rpc, cumu_compaction_cnt++ (thread
1)
3 meta service, get tablet meta rpc, get cumu_compaction_cnt = 11
(thread 2)
4 BE,get tablet meta rpc return,update tablet cumu_compaction_cnt = 11
(thread 2)
5 BE,commit compaction job rpc return,update cumu_compaction_cnt = 12
(thread 1)
---
be/src/cloud/cloud_base_compaction.cpp | 2 +-
be/src/cloud/cloud_cumulative_compaction.cpp | 3 +--
be/src/cloud/cloud_full_compaction.cpp | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/be/src/cloud/cloud_base_compaction.cpp
b/be/src/cloud/cloud_base_compaction.cpp
index 4f9ddf5d655..d4a86743a48 100644
--- a/be/src/cloud/cloud_base_compaction.cpp
+++ b/be/src/cloud/cloud_base_compaction.cpp
@@ -317,7 +317,7 @@ Status CloudBaseCompaction::modify_rowsets() {
cloud_tablet()->add_rowsets({_output_rowset}, false, wrlock);
// ATTN: MUST NOT update `cumu_compaction_cnt` or `cumu_point` which
are used when sync rowsets, otherwise may cause
// the tablet to be unable to synchronize the rowset meta changes
generated by cumu compaction.
-
cloud_tablet()->set_base_compaction_cnt(cloud_tablet()->base_compaction_cnt() +
1);
+ cloud_tablet()->set_base_compaction_cnt(stats.base_compaction_cnt());
if (output_rowset_delete_bitmap) {
_tablet->tablet_meta()->delete_bitmap().merge(*output_rowset_delete_bitmap);
}
diff --git a/be/src/cloud/cloud_cumulative_compaction.cpp
b/be/src/cloud/cloud_cumulative_compaction.cpp
index f1e9f329254..de318f979a5 100644
--- a/be/src/cloud/cloud_cumulative_compaction.cpp
+++ b/be/src/cloud/cloud_cumulative_compaction.cpp
@@ -286,8 +286,7 @@ Status CloudCumulativeCompaction::modify_rowsets() {
}
// ATTN: MUST NOT update `base_compaction_cnt` which are used when
sync rowsets, otherwise may cause
// the tablet to be unable to synchronize the rowset meta changes
generated by base compaction.
-
cloud_tablet()->set_cumulative_compaction_cnt(cloud_tablet()->cumulative_compaction_cnt()
+
- 1);
+
cloud_tablet()->set_cumulative_compaction_cnt(stats.cumulative_compaction_cnt());
cloud_tablet()->set_cumulative_layer_point(stats.cumulative_point());
if (output_rowset_delete_bitmap) {
_tablet->tablet_meta()->delete_bitmap().merge(*output_rowset_delete_bitmap);
diff --git a/be/src/cloud/cloud_full_compaction.cpp
b/be/src/cloud/cloud_full_compaction.cpp
index c5747d82fb8..12b70262252 100644
--- a/be/src/cloud/cloud_full_compaction.cpp
+++ b/be/src/cloud/cloud_full_compaction.cpp
@@ -233,7 +233,7 @@ Status CloudFullCompaction::modify_rowsets() {
// Try to make output rowset visible immediately in tablet cache,
instead of waiting for next synchronization from meta-service.
cloud_tablet()->delete_rowsets(_input_rowsets, wrlock);
cloud_tablet()->add_rowsets({_output_rowset}, false, wrlock);
-
cloud_tablet()->set_base_compaction_cnt(cloud_tablet()->base_compaction_cnt() +
1);
+ cloud_tablet()->set_base_compaction_cnt(stats.base_compaction_cnt());
cloud_tablet()->set_cumulative_layer_point(stats.cumulative_point());
if (output_rowset_delete_bitmap) {
_tablet->tablet_meta()->delete_bitmap().merge(*output_rowset_delete_bitmap);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]