get storage id from stoage_ids.conf when id not exist in data file

multi_ipaddr
YuQing 2019-10-15 19:04:04 +08:00
parent 6aa9e83bc3
commit 0ead100d59
1 changed files with 15 additions and 7 deletions

View File

@ -3591,13 +3591,21 @@ static int tracker_mem_add_storage_from_file(FDFSGroups *pGroups,
{ {
if (storage_id == NULL || *storage_id == '\0') if (storage_id == NULL || *storage_id == '\0')
{ {
logError("file: "__FILE__", line: %d, " FDFSStorageIdInfo *idInfo;
"in the file \"%s/%s\", " idInfo = fdfs_get_storage_id_by_ip(group_name, ip_addr);
"group: %s, item \"%s\" is not found or empty", if (idInfo == NULL)
__LINE__, data_path, {
STORAGE_SERVERS_LIST_FILENAME_NEW, logError("file: "__FILE__", line: %d, "
group_name, STORAGE_ITEM_SERVER_ID); "in the file \"%s/%s\", "
return ENOENT; "group: %s, item \"%s\" is not found or empty, "
"and storage ip %s not configed in storage_ids.conf",
__LINE__, data_path,
STORAGE_SERVERS_LIST_FILENAME_NEW,
group_name, STORAGE_ITEM_SERVER_ID, ip_addr);
return ENOENT;
}
storage_id = idInfo->id;
} }
} }