Check disk file metadata on delete requests
In the case where a disk file has a wrong archive ID in its extended attributes, deletion of the disk file will delete the wrong archive file in CTA.
The deleted file could be the tape copy of a completely different file on a different VO.
The code below for deleting files should be amended to check that disk file metadata matches (instance name and disk file ID) and not rely on the archive file ID alone.
//------------------------------------------------------------------------------
// deleteArchive
//------------------------------------------------------------------------------
void Scheduler::deleteArchive(const std::string &instanceName, const common::dataStructures::DeleteArchiveRequest &request,
log::LogContext & lc) {
// We have different possible scenarios here. The file can be safe in the catalogue,
// fully queued, or partially queued.
// First, make sure the file is not queued anymore.
utils::Timer t;
log::TimingList tl;
if(request.address) {
//Check if address is provided, we can remove the request from the objectstore
m_db.cancelArchive(request,lc);
// no need to do anything else, if file was failed it will not be in the catalogue.
}
tl.insertAndReset("schedulerDbTime",t);
m_catalogue.ArchiveFile()->moveArchiveFileToRecycleLog(request,lc);
tl.insertAndReset("catalogueTime",t);
log::ScopedParamContainer spc(lc);
tl.addToLog(spc);
lc.log(log::INFO, "In Scheduler::deleteArchive(): success.");
}