From 0376cf8e2cc057b2da90547fbfc67ef74976310b Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Wed, 15 Feb 2023 12:44:53 +0800 Subject: [PATCH] bugfixed: report connections' current_count and max_count correctly --- README.md | 12 ++++++------ storage/storage_dump.c | 4 ++-- storage/tracker_client_thread.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9802228..c43d450 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ Please visit the FastDFS Home Page for more detail. Chinese language: http://www.fastken.com/ -FastDFS is an open source high performance distributed file system. Its major +FastDFS is an open source high performance distributed file system. Its major functions include: file storing, file syncing and file accessing (file uploading -and file downloading), and it can resolve the high capacity and load balancing +and file downloading), and it can resolve the high capacity and load balancing problem. FastDFS should meet the requirement of the website whose service based on files such as photo sharing site and video sharing site. -FastDFS has two roles: tracker and storage. The tracker takes charge of +FastDFS has two roles: tracker and storage. The tracker takes charge of scheduling and load balancing for file access. The storage store files and it's function is file management including: file storing, file syncing, providing file access interface. It also manage the meta data which are attributes representing @@ -27,13 +27,13 @@ The storarge servers organizing by the file volume/group to obtain high capacity The storage system contains one or more volumes whose files are independent among these volumes. The capacity of the whole storage system equals to the sum of all volumes' capacity. A file volume contains one or more storage servers whose files -are same among these servers. The servers in a file volume backup each other, -and all these servers are load balancing. When adding a storage server to a +are same among these servers. The servers in a file volume backup each other, +and all these servers are load balancing. When adding a storage server to a volume, files already existing in this volume are replicated to this new server automatically, and when this replication done, system will switch this server online to providing storage services. -When the whole storage capacity is insufficiency, you can add one or more +When the whole storage capacity is insufficiency, you can add one or more volumes to expand the storage capacity. To do this, you need to add one or more storage servers. diff --git a/storage/storage_dump.c b/storage/storage_dump.c index e022a52..70871d6 100644 --- a/storage/storage_dump.c +++ b/storage/storage_dump.c @@ -366,8 +366,8 @@ static int fdfs_dump_storage_stat(char *buff, const int buffSize) "last_heart_beat_time=%s\n", g_stat_change_count, g_sync_change_count, free_queue_alloc_connections(), - g_storage_stat.connection.current_count, - g_storage_stat.connection.max_count, + SF_G_CONN_CURRENT_COUNT, + SF_G_CONN_MAX_COUNT, g_storage_stat.total_upload_count, g_storage_stat.success_upload_count, g_storage_stat.total_set_meta_count, diff --git a/storage/tracker_client_thread.c b/storage/tracker_client_thread.c index 1dcb325..0b78c82 100644 --- a/storage/tracker_client_thread.c +++ b/storage/tracker_client_thread.c @@ -2314,12 +2314,12 @@ static int tracker_heart_beat(ConnectionInfo *pTrackerServer, pStatBuff = (FDFSStorageStatBuff *)( \ out_buff + sizeof(TrackerHeader)); - int2buff(free_queue_alloc_connections(), \ + int2buff(free_queue_alloc_connections(), pStatBuff->connection.sz_alloc_count); - int2buff(g_storage_stat.connection.current_count, \ + int2buff(SF_G_CONN_CURRENT_COUNT, pStatBuff->connection.sz_current_count); - int2buff(g_storage_stat.connection.max_count, \ - pStatBuff->connection.sz_max_count); + int2buff(SF_G_CONN_MAX_COUNT, pStatBuff-> + connection.sz_max_count); long2buff(g_storage_stat.total_upload_count, \ pStatBuff->sz_total_upload_count);