Tool to delete a file copy
A tool is needed to allow the deletion of an Archive File copy.
This is necessary when the number of copies in a storage class are reduced, and an archive route is deleted. When this happens, trying to repack the tape with the deleted extra copy will fail, as there is nowhere to archive the files with this copy.
The proposed command is cta-admin tf rm --vid/-v <vid> [--instance/-i <disk_instance>] [--fxid/-f <eos_fxid>] [--id/-I <archive_file_id>] --reason/-r "<reason>"
Vid is mandatory and specifies in which tape the copy is stored. It is assumed each tape has at most one copy of a tape file, and the tool will fail otherwise.
Either archive_file_id
of eos_fxid
must be specified. if eos_fxid
is specified, disk_instance
must also be specified to uniquely identify the archive file.
If the specified arguments don't match any tape file, the command should throw an exception.
If the specified copy is the only copy for that archive file, the command should throw an exception.
The deleted file copy should be moved to the recycle bin. In practice, this means finding the row of the file in the TAPE_FILE
table, copying its contents to a new row in the FILE_RECYCLE_LOG
and finally delete the TAPE_FILE
row. The copying and deleting should be done in an atomic fashion.
The reason that is stored in the recycle file log is prefixed with "(Deleted using cta-admin tf rm)".
The created row in the FILE_RECYCLE_LOG
will have as DiskFilePath the string "Not applicable for copies deleted with cta-admin tf rm"