Merge pull request #665 from niloay6/fix_multi_path_round_robin
fix: 多path的其中一个path存储超阈值时,store_path=0应该顺序写入,而不是每次都写第一个pathpull/673/head
commit
c7d01ff422
|
|
@ -1665,7 +1665,7 @@ void storage_service_destroy()
|
||||||
|
|
||||||
int storage_get_storage_path_index(int *store_path_index)
|
int storage_get_storage_path_index(int *store_path_index)
|
||||||
{
|
{
|
||||||
int i;
|
int i, t;
|
||||||
|
|
||||||
*store_path_index = g_store_path_index;
|
*store_path_index = g_store_path_index;
|
||||||
if (g_store_path_mode == FDFS_STORE_PATH_LOAD_BALANCE)
|
if (g_store_path_mode == FDFS_STORE_PATH_LOAD_BALANCE)
|
||||||
|
|
@ -1687,7 +1687,12 @@ int storage_get_storage_path_index(int *store_path_index)
|
||||||
[*store_path_index].total_mb, g_fdfs_store_paths.paths \
|
[*store_path_index].total_mb, g_fdfs_store_paths.paths \
|
||||||
[*store_path_index].free_mb, g_avg_storage_reserved_mb))
|
[*store_path_index].free_mb, g_avg_storage_reserved_mb))
|
||||||
{
|
{
|
||||||
for (i=0; i<g_fdfs_store_paths.count; i++)
|
t = g_store_path_index + 1;
|
||||||
|
if (t >= g_fdfs_store_paths.count)
|
||||||
|
{
|
||||||
|
t = 0;
|
||||||
|
}
|
||||||
|
for (i=t; i<g_fdfs_store_paths.count; i++)
|
||||||
{
|
{
|
||||||
if (storage_check_reserved_space_path( \
|
if (storage_check_reserved_space_path( \
|
||||||
g_fdfs_store_paths.paths[i].total_mb, \
|
g_fdfs_store_paths.paths[i].total_mb, \
|
||||||
|
|
|
||||||
|
|
@ -2681,8 +2681,13 @@ static int tracker_deal_service_query_storage( \
|
||||||
path_total_mbs[write_path_index], pStorageServer-> \
|
path_total_mbs[write_path_index], pStorageServer-> \
|
||||||
path_free_mbs[write_path_index], avg_reserved_mb))
|
path_free_mbs[write_path_index], avg_reserved_mb))
|
||||||
{
|
{
|
||||||
int i;
|
int i, t;
|
||||||
for (i=0; i<pStoreGroup->store_path_count; i++)
|
t = write_path_index + 1;
|
||||||
|
if (t >= pStoreGroup->store_path_count)
|
||||||
|
{
|
||||||
|
t = 0;
|
||||||
|
}
|
||||||
|
for (i=t; i<pStoreGroup->store_path_count; i++)
|
||||||
{
|
{
|
||||||
if (tracker_check_reserved_space_path( \
|
if (tracker_check_reserved_space_path( \
|
||||||
pStorageServer->path_total_mbs[i], \
|
pStorageServer->path_total_mbs[i], \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue