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 12164900352 [fix](cloud-mow)Full compaction no need to sync delete
bitmap (#43337)
12164900352 is described below
commit 121649003522f50cf9efb4af42a04a3e7f1ebd9a
Author: huanghaibin <[email protected]>
AuthorDate: Fri Nov 8 16:27:18 2024 +0800
[fix](cloud-mow)Full compaction no need to sync delete bitmap (#43337)
sync delete bitmap may cost too much time,which may lead to full
compaction fail, but full compaction no need to sync it.
---
be/src/cloud/cloud_compaction_action.cpp | 5 +++--
be/src/cloud/cloud_meta_mgr.cpp | 5 +++--
be/src/cloud/cloud_meta_mgr.h | 3 ++-
be/src/cloud/cloud_tablet_mgr.cpp | 11 ++++++-----
be/src/cloud/cloud_tablet_mgr.h | 3 ++-
5 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/be/src/cloud/cloud_compaction_action.cpp
b/be/src/cloud/cloud_compaction_action.cpp
index 13161c32c8e..481f7b589fe 100644
--- a/be/src/cloud/cloud_compaction_action.cpp
+++ b/be/src/cloud/cloud_compaction_action.cpp
@@ -149,8 +149,9 @@ Status
CloudCompactionAction::_handle_run_compaction(HttpRequest* req, std::stri
compaction_type != PARAM_COMPACTION_FULL) {
return Status::NotSupported("The compaction type '{}' is not
supported", compaction_type);
}
-
- CloudTabletSPtr tablet =
DORIS_TRY(_engine.tablet_mgr().get_tablet(tablet_id));
+ bool sync_delete_bitmap = compaction_type != PARAM_COMPACTION_FULL;
+ CloudTabletSPtr tablet =
+ DORIS_TRY(_engine.tablet_mgr().get_tablet(tablet_id, false,
sync_delete_bitmap));
if (tablet == nullptr) {
return Status::NotFound("Tablet not found. tablet_id={}", tablet_id);
}
diff --git a/be/src/cloud/cloud_meta_mgr.cpp b/be/src/cloud/cloud_meta_mgr.cpp
index 7e52d7e5949..ae98a7f6058 100644
--- a/be/src/cloud/cloud_meta_mgr.cpp
+++ b/be/src/cloud/cloud_meta_mgr.cpp
@@ -384,7 +384,8 @@ Status CloudMetaMgr::get_tablet_meta(int64_t tablet_id,
TabletMetaSharedPtr* tab
return Status::OK();
}
-Status CloudMetaMgr::sync_tablet_rowsets(CloudTablet* tablet, bool
warmup_delta_data) {
+Status CloudMetaMgr::sync_tablet_rowsets(CloudTablet* tablet, bool
warmup_delta_data,
+ bool sync_delete_bitmap) {
using namespace std::chrono;
TEST_SYNC_POINT_RETURN_WITH_VALUE("CloudMetaMgr::sync_tablet_rowsets",
Status::OK(), tablet);
@@ -465,7 +466,7 @@ Status CloudMetaMgr::sync_tablet_rowsets(CloudTablet*
tablet, bool warmup_delta_
// If is mow, the tablet has no delete bitmap in base rowsets.
// So dont need to sync it.
- if (tablet->enable_unique_key_merge_on_write() &&
+ if (sync_delete_bitmap && tablet->enable_unique_key_merge_on_write() &&
tablet->tablet_state() == TABLET_RUNNING) {
DeleteBitmap delete_bitmap(tablet_id);
int64_t old_max_version = req.start_version() - 1;
diff --git a/be/src/cloud/cloud_meta_mgr.h b/be/src/cloud/cloud_meta_mgr.h
index 2b103e20f12..a657c0fdd8e 100644
--- a/be/src/cloud/cloud_meta_mgr.h
+++ b/be/src/cloud/cloud_meta_mgr.h
@@ -57,7 +57,8 @@ public:
Status get_tablet_meta(int64_t tablet_id, std::shared_ptr<TabletMeta>*
tablet_meta);
- Status sync_tablet_rowsets(CloudTablet* tablet, bool warmup_delta_data =
false);
+ Status sync_tablet_rowsets(CloudTablet* tablet, bool warmup_delta_data =
false,
+ bool sync_delete_bitmap = true);
Status prepare_rowset(const RowsetMeta& rs_meta,
std::shared_ptr<RowsetMeta>* existed_rs_meta =
nullptr);
diff --git a/be/src/cloud/cloud_tablet_mgr.cpp
b/be/src/cloud/cloud_tablet_mgr.cpp
index 7ecb72e62fd..e7a7d254f3f 100644
--- a/be/src/cloud/cloud_tablet_mgr.cpp
+++ b/be/src/cloud/cloud_tablet_mgr.cpp
@@ -149,8 +149,8 @@ void set_tablet_access_time_ms(CloudTablet* tablet) {
tablet->last_access_time_ms = now;
}
-Result<std::shared_ptr<CloudTablet>> CloudTabletMgr::get_tablet(int64_t
tablet_id,
- bool
warmup_data) {
+Result<std::shared_ptr<CloudTablet>> CloudTabletMgr::get_tablet(int64_t
tablet_id, bool warmup_data,
+ bool
sync_delete_bitmap) {
// LRU value type. `Value`'s lifetime MUST NOT be longer than
`CloudTabletMgr`
class Value : public LRUCacheValueBase {
public:
@@ -168,8 +168,8 @@ Result<std::shared_ptr<CloudTablet>>
CloudTabletMgr::get_tablet(int64_t tablet_i
CacheKey key(tablet_id_str);
auto* handle = _cache->lookup(key);
if (handle == nullptr) {
- auto load_tablet = [this, &key,
- warmup_data](int64_t tablet_id) ->
std::shared_ptr<CloudTablet> {
+ auto load_tablet = [this, &key, warmup_data,
+ sync_delete_bitmap](int64_t tablet_id) ->
std::shared_ptr<CloudTablet> {
TabletMetaSharedPtr tablet_meta;
auto st = _engine.meta_mgr().get_tablet_meta(tablet_id,
&tablet_meta);
if (!st.ok()) {
@@ -180,7 +180,8 @@ Result<std::shared_ptr<CloudTablet>>
CloudTabletMgr::get_tablet(int64_t tablet_i
auto tablet = std::make_shared<CloudTablet>(_engine,
std::move(tablet_meta));
auto value = std::make_unique<Value>(tablet, *_tablet_map);
// MUST sync stats to let compaction scheduler work correctly
- st = _engine.meta_mgr().sync_tablet_rowsets(tablet.get(),
warmup_data);
+ st = _engine.meta_mgr().sync_tablet_rowsets(tablet.get(),
warmup_data,
+ sync_delete_bitmap);
if (!st.ok()) {
LOG(WARNING) << "failed to sync tablet " << tablet_id << ": "
<< st;
return nullptr;
diff --git a/be/src/cloud/cloud_tablet_mgr.h b/be/src/cloud/cloud_tablet_mgr.h
index 903f372cbde..cbbd119a36b 100644
--- a/be/src/cloud/cloud_tablet_mgr.h
+++ b/be/src/cloud/cloud_tablet_mgr.h
@@ -43,7 +43,8 @@ public:
// If the tablet is in cache, return this tablet directly; otherwise will
get tablet meta first,
// sync rowsets after, and download segment data in background if
`warmup_data` is true.
- Result<std::shared_ptr<CloudTablet>> get_tablet(int64_t tablet_id, bool
warmup_data = false);
+ Result<std::shared_ptr<CloudTablet>> get_tablet(int64_t tablet_id, bool
warmup_data = false,
+ bool sync_delete_bitmap =
true);
void erase_tablet(int64_t tablet_id);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]