From 84cf0b841654d630244afa03e0abc35ea8741047 Mon Sep 17 00:00:00 2001 From: Siyang Tang Date: Wed, 25 Dec 2024 22:21:20 +0800 Subject: [PATCH] [enhancement](meta) Sync tablet meta even if local state is not running (#45821) Avoid a running tablet keep not running state on single one BE with no query. Even if it is a tablet with high compaction score, compaction will fail on this BE since not running state. Before this PR, scheduled tablet meta sync will skip not running tablets. In this PR, we include those tablets in meta sync procedure to avoid long-term inaccurate tablet state. --- be/src/cloud/cloud_tablet.cpp | 3 --- be/src/cloud/cloud_tablet_mgr.cpp | 3 --- 2 files changed, 6 deletions(-) diff --git a/be/src/cloud/cloud_tablet.cpp b/be/src/cloud/cloud_tablet.cpp index 4325d568b55fe3..be529b37dd9f5c 100644 --- a/be/src/cloud/cloud_tablet.cpp +++ b/be/src/cloud/cloud_tablet.cpp @@ -864,9 +864,6 @@ Status CloudTablet::sync_meta() { } return st; } - if (tablet_meta->tablet_state() != TABLET_RUNNING) { // impossible - return Status::InternalError("invalid tablet state. tablet_id={}", tablet_id()); - } auto new_ttl_seconds = tablet_meta->ttl_seconds(); if (_tablet_meta->ttl_seconds() != new_ttl_seconds) { diff --git a/be/src/cloud/cloud_tablet_mgr.cpp b/be/src/cloud/cloud_tablet_mgr.cpp index e7a7d254f3fa89..f60d0eeb5ba0dd 100644 --- a/be/src/cloud/cloud_tablet_mgr.cpp +++ b/be/src/cloud/cloud_tablet_mgr.cpp @@ -261,9 +261,6 @@ void CloudTabletMgr::sync_tablets(const CountDownLatch& stop_latch) { for (auto& weak_tablet : weak_tablets) { if (auto tablet = weak_tablet.lock()) { - if (tablet->tablet_state() != TABLET_RUNNING) { - continue; - } int64_t last_sync_time = tablet->last_sync_time_s; if (last_sync_time <= last_sync_time_bound) { sync_time_tablet_set.emplace(last_sync_time, weak_tablet);