Skip to content

Properly report error in WFE when trying to archive a File ID that already exists in the CTA Catalogue

Problem

As shown in #1002, if we resubmit a CLOSEW event with the same disk_instance_name/disk_file_id pair, this will result into a badly handled DB constraint violation, which is not clearly reported back to the user.

"commit problem committing the DB transaction: Database library reported: ERROR:  duplicate key value violates unique constraint \"archive_file_din_dfi_un\"DETAIL:  Key (disk_instance_name, disk_file_id)=(eoscta, 0000AEC65EE5F77D43B89B1E759F9D0B4400) already exists. (DB Result Status:7 SQLState:23505)"

Solution

EOS is not expected to resubmit a CLOSEW event to CTA. However, the same is not true for dCache...

Instead of letting it fail internally, we should report this error back to the user (after the constraint violation is detected), the same way that we treat any other archive failures.

This does not change the way how the WFE engine works, but gives a much more clear message to the client about what went wrong.