From 01041705ba998b53cfde1ed8d6d6230e143a7bfe Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Wed, 4 Dec 2019 20:19:43 +0800 Subject: [PATCH] calc hash use src_filename when it not empty --- storage/storage_disk_recovery.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/storage/storage_disk_recovery.c b/storage/storage_disk_recovery.c index 6d334cd..9163f5d 100644 --- a/storage/storage_disk_recovery.c +++ b/storage/storage_disk_recovery.c @@ -1071,6 +1071,7 @@ static int do_dispatch_binlog_for_threads(const char *pBasePath) RecoveryDispatchInfo *dispatchs; RecoveryDispatchInfo *disp; int64_t total_count; + int hash_code; int bytes; int result; int i; @@ -1128,8 +1129,18 @@ static int do_dispatch_binlog_for_threads(const char *pBasePath) break; } - disp = dispatchs + (unsigned int)(Time33Hash(record.filename, - record.filename_len)) % g_disk_recovery_threads; + if (record.src_filename_len > 0) + { + hash_code = Time33Hash(record.src_filename, + record.src_filename_len); + } + else + { + hash_code = Time33Hash(record.filename, + record.filename_len); + } + disp = dispatchs + ((unsigned int)hash_code) % + g_disk_recovery_threads; if ((result=disk_recovery_write_to_binlog(disp->fp, disp->temp_filename, &record)) != 0) {