From 9b675d1fe4b117a6911722072ce3faadeddc6bce Mon Sep 17 00:00:00 2001 From: xuchang Date: Mon, 29 Jan 2024 09:44:57 +0800 Subject: [PATCH] repair: resolve load_history shard load skew Using uuid_xor_to_uint32 instance of table_uuid's most_significant_bits, optimize the hash conflict to shard. --- repair/row_level.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repair/row_level.cc b/repair/row_level.cc index c443b4a4ca..cb9408e6eb 100644 --- a/repair/row_level.cc +++ b/repair/row_level.cc @@ -3230,7 +3230,7 @@ future<> repair_service::cleanup_history(tasks::task_id repair_id) { future<> repair_service::load_history() { co_await get_db().local().get_tables_metadata().parallel_for_each_table(coroutine::lambda([&] (table_id table_uuid, lw_shared_ptr table) -> future<> { - auto shard = unsigned(table_uuid.uuid().get_most_significant_bits()) % smp::count; + auto shard = utils::uuid_xor_to_uint32(table_uuid.uuid()) % smp::count; if (shard != this_shard_id()) { co_return; }