From 856ef15ab7c3ccb817a9871156a07d1b11543077 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Wed, 4 Dec 2019 20:00:34 +0800 Subject: [PATCH] fix recovery_get_global_full_filename --- storage/storage_disk_recovery.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/storage/storage_disk_recovery.c b/storage/storage_disk_recovery.c index 2345ef3..6d334cd 100644 --- a/storage/storage_disk_recovery.c +++ b/storage/storage_disk_recovery.c @@ -104,7 +104,7 @@ static inline char *recovery_get_global_full_filename(const char *pBasePath, const char *filename, char *full_filename) { return recovery_get_full_filename_ex(pBasePath, -1, - RECOVERY_FLAG_FILENAME, full_filename); + filename, full_filename); } static inline char *recovery_get_global_binlog_filename(const char *pBasePath, @@ -1266,6 +1266,7 @@ static int storage_disk_recovery_do_restore(const char *pBasePath) int bytes; int i; int k; + int sig; pthread_t *recovery_tids; void **args; RecoveryThreadData *thread_data; @@ -1329,7 +1330,10 @@ static int storage_disk_recovery_do_restore(const char *pBasePath) if (__sync_fetch_and_add(¤t_recovery_thread_count, 0) > 0) { - for (i=0; i<30; i++) +#define MAX_WAIT_COUNT 30 + + sig = SIGINT; + for (i=0; i= MAX_WAIT_COUNT / 2) + { + sig = SIGTERM; + } + for (k=0; k 0) { - pthread_kill(thread_data[k].tid, SIGINT); + pthread_kill(thread_data[k].tid, sig); } }