storage join add field: current_tracker_ip
parent
1143859c86
commit
f756b5ee94
|
|
@ -1916,6 +1916,7 @@ int tracker_report_join(ConnectionInfo *pTrackerServer, \
|
|||
long2buff(g_storage_join_time, pReqBody->join_time);
|
||||
long2buff(g_up_time, pReqBody->up_time);
|
||||
pReqBody->init_flag = sync_old_done ? 0 : 1;
|
||||
strcpy(pReqBody->current_tracker_ip, pTrackerServer->ip_addr);
|
||||
|
||||
memset(&targetServer, 0, sizeof(targetServer));
|
||||
pTargetServer = &targetServer;
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ typedef struct
|
|||
char domain_name[FDFS_DOMAIN_NAME_MAX_SIZE];
|
||||
char init_flag;
|
||||
signed char status;
|
||||
char current_tracker_ip[IP_ADDRESS_SIZE]; //current tracker ip address
|
||||
char tracker_count[FDFS_PROTO_PKG_LEN_SIZE]; //all tracker server count
|
||||
} TrackerStorageJoinBody;
|
||||
|
||||
|
|
|
|||
|
|
@ -1529,10 +1529,21 @@ static int tracker_deal_storage_join(struct fast_task_info *pTask)
|
|||
joinBody.init_flag = pBody->init_flag;
|
||||
joinBody.status = pBody->status;
|
||||
|
||||
pBody->current_tracker_ip[IP_ADDRESS_SIZE - 1] = '\0';
|
||||
|
||||
getSockIpaddr(pTask->event.fd,
|
||||
tracker_ip, IP_ADDRESS_SIZE);
|
||||
insert_into_local_host_ip(tracker_ip);
|
||||
|
||||
if (strcmp(tracker_ip, pBody->current_tracker_ip) != 0)
|
||||
{
|
||||
logInfo("file: "__FILE__", line: %d, "
|
||||
"storage ip: %s, tracker ip by socket: %s, "
|
||||
"tracker ip by report: %s", __LINE__, pTask->client_ip,
|
||||
tracker_ip, pBody->current_tracker_ip);
|
||||
insert_into_local_host_ip(pBody->current_tracker_ip);
|
||||
}
|
||||
|
||||
result = tracker_mem_add_group_and_storage(pClientInfo,
|
||||
pTask->client_ip, &joinBody, true);
|
||||
if (result != 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue