From 56be2e5a1a294cf3cf46de094b2d1ae32285e443 Mon Sep 17 00:00:00 2001 From: yixiutt <102007456+yixiutt@users.noreply.github.com> Date: Fri, 3 Feb 2023 21:49:37 +0800 Subject: [PATCH] [bugfix](disk balance) fix new rowset time check when add tablet (#16261) In disk balancer, if a tablet is in highly concurrent load, new rowset creation time(which use current time) may be same as the newest rowset, and when add tablet, there has a creation time check that new_time must bigger than old time, so disk balancer will failed many times and makes this tablet lose many verisons as migration will block writes. --- be/src/olap/tablet_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp index 2d3aedd061..87334cbfe2 100644 --- a/be/src/olap/tablet_manager.cpp +++ b/be/src/olap/tablet_manager.cpp @@ -157,7 +157,7 @@ Status TabletManager::_add_tablet_unlocked(TTabletId tablet_id, const TabletShar // here, the new rowset's file will also be dropped, so use keep files here bool keep_files = force ? true : false; if (force || - (new_version > old_version || (new_version == old_version && new_time > old_time))) { + (new_version > old_version || (new_version == old_version && new_time >= old_time))) { // check if new tablet's meta is in store and add new tablet's meta to meta store res = _add_tablet_to_map_unlocked(tablet_id, tablet, update_meta, keep_files, true /*drop_old*/);