Skip to content

Add option in cta-admin to identify dual tape files that only have one copy

Problem

As shown in https://gitlab.cern.ch/cta/operations/-/issues/1584#note_8965010, we need to be able to easily identify all dual-copy tape files that only have one copy. Currently, this is only possible using SQL directly.

With this info we should be able to restore the missing copies (currently by repacking the tapes with the "good" copies), ideally with a scheduled procedure.

Proposal

Create a cta-admin command that lists all the missing tape file copies.

Suggestion 1

Reuse an the command tapefile ls, by adding a simple option --incompletefilecopies:

  • New entry "copyNb": <value> inside "af".
cta-admin --json tapefile ls --incompletefilecopies
  {
    "af": {
      "archiveId": "4303581607",
      "storageClass": "cbacktest",
      "creationTime": "1679493768",
      "copyNb": 2,
      "checksum": [
        {
          "type": "ADLER32",
          "value": "3c777549"
        }
      ],
      "size": "1811"
    },
    "df": {
      "diskId": "4302619856",
      "diskInstance": "eosctaatlaspps",
      "ownerId": {
        "uid": 89952,
        "gid": 4
      },
      "path": ""
    },
    "tf": {
      "vid": "I72510",
      "copyNb": 1,
      "blockId": "0",
      "fSeq": "1"
    }
  }
]
  • New column total cp.
cta-admin tapefile ls --incompletefilecopies
archive id copy no total cp    vid fseq block id       instance  disk fxid   size checksum type checksum value storage class owner group    creation time
4303581607       1        2 I72510    1        0 eosctaatlaspps 4302619856   1.8K       ADLER32       3c777549     cbacktest 89952     4 2023-03-22 15:02
4303581631       1        2 I72510    2       11 eosctaatlaspps 4302619865  28.2M       ADLER32       c67d5380     cbacktest 89952  2766 2023-03-27 17:48
4303581634       1        2 I72510    3      128 eosctaatlaspps 4302619868 756.4M       ADLER32       9e3f433d     cbacktest 89952  2766 2023-03-28 10:51

Suggestion 2

Reuse an the command tape ls, by also adding a simple option --incompletefilecopies, which lists all tapes that include files with incomplete tape copies.

It should have a similar behaviour to --all. The output is the same as tape ls.

Edited by Joao Afonso