Commit 22d62aac authored by Giuseppe Lo Presti's avatar Giuseppe Lo Presti
Browse files

Fixed #104892: Concurrent repack of dual copy files does not generate two racing recall jobs

parent d55aee9b
......@@ -247,10 +247,11 @@ BEGIN
AND DiskServer.hwOnline = 1
AND DC.status = dconst.DISKCOPY_VALID;
IF varNbCopies = 0 THEN
-- find out whether this file is already being recalled
SELECT count(*) INTO varWasRecalled FROM RecallJob WHERE castorfile = cfId AND ROWNUM < 2;
-- find out whether this file is already being recalled from this tape
SELECT count(*) INTO varWasRecalled FROM RecallJob WHERE castorfile = cfId AND vid != varRepackVID;
IF varWasRecalled = 0 THEN
-- trigger recall
-- trigger recall: if we have dual copy files, this may trigger a second recall,
-- which will race with the first as it happens for user-driven recalls
triggerRepackRecall(cfId, segment.fileid, nsHostName, segment.blockid,
segment.fseq, segment.copyNb, varEuid, varEgid,
varRecallGroupId, svcClassId, varRepackVID, segment.segSize,
......
......@@ -882,7 +882,6 @@ BEGIN
WHERE SR.castorFile = inCfId
AND SR.status IN (dconst.SUBREQUEST_WAITTAPERECALL, dconst.SUBREQUEST_WAITSUBREQ);
END IF;
-- commit
COMMIT;
END;
/
......
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