Commit bf0e6c51 authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Fixed bug #103530: tight loop in rebalancing when no file to rebalance

parent c5519379
......@@ -135,10 +135,13 @@ BEGIN
LOOP
-- Fetch next candidate
FETCH DCcur INTO varDcId, varDcSize, varCfId, varNsOpenTime;
-- no next candidate : this is surprising, but nevertheless, we should go out of the loop
IF DCcur%NOTFOUND THEN EXIT; END IF;
-- stop if it would be too much
IF varTotalRebalanced + varDcSize > inDataAmount THEN EXIT; END IF;
-- compute new totals
varTotalRebalanced := varTotalRebalanced + varDcSize;
varNbFilesRebalanced := varNbFilesRebalanced + 1;
-- stop if it would be too much
IF varTotalRebalanced > inDataAmount THEN EXIT; END IF;
-- create disk2DiskCopyJob for this diskCopy
createDisk2DiskCopyJob(varCfId, varNsOpenTime, inDestSvcClassId,
0, 0, dconst.REPLICATIONTYPE_REBALANCE,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment