From 8c5a6b6f004ed373542f4ff34e3b75a85a1a5ae2 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Wed, 25 Dec 2019 19:26:58 +0800 Subject: [PATCH] fdfs_monitor.c: do NOT call getHostnameByIp --- HISTORY | 6 +++++- INSTALL | 2 +- client/fdfs_monitor.c | 3 ++- conf/tracker.conf | 6 +++--- storage/trunk_mgr/trunk_mem.c | 10 +++++----- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/HISTORY b/HISTORY index f7e5842..c1a305d 100644 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,5 @@ -Version 6.05 2019-12-24 +Version 6.05 2019-12-25 * fdfs_trackerd and fdfs_storaged print the server version in usage. you can execute fdfs_trackerd or fdfs_storaged without parameters to show the server version @@ -22,6 +22,10 @@ Version 6.05 2019-12-24 * support delete unused trunk files the config item in tracker.conf: delete_unused_trunk_files + * fdfs_monitor.c: do NOT call getHostnameByIp + + NOTE: you MUST upgrade libfastcommon to V1.43 or later + Version 6.04 2019-12-05 * storage_report_ip_changed ignore result EEXIST diff --git a/INSTALL b/INSTALL index 2d730da..3bf83df 100644 --- a/INSTALL +++ b/INSTALL @@ -11,7 +11,7 @@ Chinese language: http://www.fastken.com/ # command lines as: git clone https://github.com/happyfish100/libfastcommon.git - cd libfastcommon; git checkout V1.0.42 + cd libfastcommon; git checkout V1.0.43 ./make.sh clean && ./make.sh && ./make.sh install diff --git a/client/fdfs_monitor.c b/client/fdfs_monitor.c index d648cab..5adae26 100644 --- a/client/fdfs_monitor.c +++ b/client/fdfs_monitor.c @@ -389,7 +389,8 @@ static int list_storages(FDFSGroupStat *pGroupStat) } } - getHostnameByIp(pStorage->ip_addr, szHostname, sizeof(szHostname)); + //getHostnameByIp(pStorage->ip_addr, szHostname, sizeof(szHostname)); + *szHostname = '\0'; if (*szHostname != '\0') { sprintf(szHostnamePrompt, " (%s)", szHostname); diff --git a/conf/tracker.conf b/conf/tracker.conf index 5ffdfe8..6bf3f4b 100644 --- a/conf/tracker.conf +++ b/conf/tracker.conf @@ -146,7 +146,7 @@ use_trunk_file = false # the min slot size, should <= 4KB # default value is 256 bytes # since V3.00 -slot_min_size = 512 +slot_min_size = 256 # the max slot size, should > slot_min_size # store the upload file to trunk file when it's size <= this value @@ -159,7 +159,7 @@ slot_max_size = 1MB # since V6.05 # NOTE: the larger the alignment size, the less likely of disk # fragmentation, but the more space is wasted. -trunk_alloc_alignment_size = 512 +trunk_alloc_alignment_size = 256 # if merge contiguous free spaces of trunk file # default value is false @@ -169,7 +169,7 @@ trunk_free_space_merge = true # if delete / reclaim the unused trunk files # default value is false # since V6.05 -delete_unused_trunk_files = true +delete_unused_trunk_files = false # the trunk file size, should >= 4MB # default value is 64MB diff --git a/storage/trunk_mgr/trunk_mem.c b/storage/trunk_mgr/trunk_mem.c index b347e69..a5ff2ff 100644 --- a/storage/trunk_mgr/trunk_mem.c +++ b/storage/trunk_mgr/trunk_mem.c @@ -549,6 +549,11 @@ static int trunk_merge_spaces(FDFSTrunkFullInfo **ppMergeFirst, merge_stat->merged_trunk_count += (ppLast - ppMergeFirst) + 1; merge_stat->merged_size += merged_size; + for (ppTrunkInfo=ppMergeFirst + 1; ppTrunkInfo<=ppLast; ppTrunkInfo++) + { + trunk_delete_space_ex(*ppTrunkInfo, false, false); + } + do { if (!g_delete_unused_trunk_files) @@ -612,11 +617,6 @@ static int trunk_merge_spaces(FDFSTrunkFullInfo **ppMergeFirst, false, false, &result); } - for (ppTrunkInfo=ppMergeFirst + 1; ppTrunkInfo<=ppLast; ppTrunkInfo++) - { - trunk_delete_space_ex(*ppTrunkInfo, false, false); - } - return result; }