From df2fd2069b085bd78c7876d7967ccc5e7c489659 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Wed, 27 Nov 2019 20:33:56 +0800 Subject: [PATCH] storage_report_ip_changed ignore result EEXIST --- conf/storage.conf | 5 +++-- storage/storage_ip_changed_dealer.c | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/conf/storage.conf b/conf/storage.conf index 9adfa6a..0bc0019 100644 --- a/conf/storage.conf +++ b/conf/storage.conf @@ -173,8 +173,9 @@ allow_hosts=* # 1: random, distributted by hash code file_distribute_path_mode=0 -# valid when file_distribute_to_path is set to 0 (round robin), -# when the written file count reaches this number, then rotate to next path +# valid when file_distribute_to_path is set to 0 (round robin). +# when the written file count reaches this number, then rotate to next path. +# rotate to the first path (00/00) after the last path (such as FF/FF). # default value is 100 file_distribute_rotate_count=100 diff --git a/storage/storage_ip_changed_dealer.c b/storage/storage_ip_changed_dealer.c index 58e4af6..e550314 100644 --- a/storage/storage_ip_changed_dealer.c +++ b/storage/storage_ip_changed_dealer.c @@ -92,10 +92,11 @@ static int storage_report_ip_changed(ConnectionInfo *pTrackerServer) } pInBuff = in_buff; - result = fdfs_recv_response(pTrackerServer, \ + result = fdfs_recv_response(pTrackerServer, &pInBuff, 0, &in_bytes); - if (result == 0 || result == EALREADY || result == ENOENT) + if (result == 0 || result == EALREADY || result == ENOENT + || result == EEXIST) { if (result != 0) { @@ -107,11 +108,11 @@ static int storage_report_ip_changed(ConnectionInfo *pTrackerServer) } else { - logError("file: "__FILE__", line: %d, " \ - "tracker server %s:%d, recv data fail or " \ - "response status != 0, " \ - "errno: %d, error info: %s", \ - __LINE__, pTrackerServer->ip_addr, \ + logError("file: "__FILE__", line: %d, " + "tracker server %s:%d, recv data fail or " + "response status != 0, " + "errno: %d, error info: %s", + __LINE__, pTrackerServer->ip_addr, pTrackerServer->port, result, STRERROR(result)); return result == EBUSY ? 0 : result; }