Commit eb707601 authored by Giuseppe Lo Presti's avatar Giuseppe Lo Presti
Browse files

Fixed bug #104708: Integrity constraint violated in GC,

and related to bug #105068: Draining looping when having shared pools and replicated files.

Renamed the new constraint introduced in DrainingErrors to respect the
convention. This is actually used in oracleGC.sql:483 in 2_1_14, not in
the master.
Fixed the constraint violation to be ignored by the GC.
parent 3139bdde
......@@ -1292,7 +1292,7 @@ ENABLE ROW MOVEMENT;
CREATE INDEX I_DrainingErrors_DJ_CF ON DrainingErrors (drainingJob, CastorFile);
ALTER TABLE DrainingErrors
ADD CONSTRAINT FK_DrainingErrors_CF
ADD CONSTRAINT FK_DrainingErrors_CastorFile
FOREIGN KEY (castorFile)
REFERENCES CastorFile (id);
......
......@@ -751,7 +751,7 @@ BEGIN
BEGIN
DELETE FROM DiskCopy WHERE id = dcIds(i);
EXCEPTION WHEN CONSTRAINT_VIOLATED THEN
IF sqlerrm LIKE '%constraint (CASTOR_STAGER.FK_DRAININGERRORS_DC) violated%' OR
IF sqlerrm LIKE '%constraint (CASTOR_STAGER.FK_DRAININGERRORS_CASTORFILE) violated%' OR
sqlerrm LIKE '%constraint (CASTOR_STAGER.FK_DISK2DISKCOPYJOB_SRCDCID) violated%' THEN
-- Ignore the deletion, this diskcopy was either implied in a draining action and
-- the draining error is still around or it is the source of another d2d copy that
......
......@@ -91,7 +91,7 @@ ALTER TABLE DrainingErrors ADD (castorFile INTEGER CONSTRAINT NN_DrainingErrors_
CREATE INDEX I_DrainingErrors_DJ_CF ON DrainingErrors (drainingJob, CastorFile);
ALTER TABLE DrainingErrors
ADD CONSTRAINT FK_DrainingErrors_CF
ADD CONSTRAINT FK_DrainingErrors_CastorFile
FOREIGN KEY (castorFile)
REFERENCES CastorFile (id);
......
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