Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tape api: diskLiftime does not seem to be respected #7687

Open
DmitryLitvintsev opened this issue Oct 31, 2024 · 0 comments
Open

tape api: diskLiftime does not seem to be respected #7687

DmitryLitvintsev opened this issue Oct 31, 2024 · 0 comments
Assignees

Comments

@DmitryLitvintsev
Copy link
Member

Using this script:

Specifying "diskLifetime"="P1D" and up with pin duration of 1 hour.

Script:


#!/usr/bin/env python

import json 
import requests
from requests.exceptions import HTTPError
import os
import sys
import time

import urllib3
urllib3.disable_warnings()

base_url = "https://uqbar:3880/api/v1/tape"

if __name__ == "__main__":
    session = requests.Session()
    session.verify = "/etc/grid-security/certificates"
    session.cert = f"/tmp/x509up_u{os.getuid()}"
    session.key = f"/tmp/x509up_u{os.getuid()}"

    headers = { "accept" : "application/json",
                "content-type" : "application/json"}

    data =  {
    	"paths" : sys.argv[1:],
    }
    
    payload = None
    try:
        #
        # check archiveinfo
        #
        r = session.post(base_url+"/archiveinfo",
                         data=json.dumps(data),
                         headers=headers)
        r.raise_for_status()
        payload =  r.json()

    except HTTPError as exc:
        print(exc)
        sys.exit(1)

    if payload:
        print(json.dumps(payload, indent=4,sort_keys=True))

        #
        # stage 
        #
        files = {"files" : [] }
        paths = []
        for datum in payload:
            path = datum.get("path")
            paths.append(path)
            files["files"].append({"diskLifetime" : "P1D",
                                   "path" : path})

        try:
            r = session.post(base_url+"/stage",
                             data=json.dumps(files),
                             headers=headers)
            r.raise_for_status()
        except HTTPError as exc:
            print(exc)
            sys.exit(1)
$ ssh -p 24223 admin@uqbar "\s PinManager ls   000081BB1343AB6A4783B342B28269116004"
[159] 000081BB1343AB6A4783B342B28269116004 (1c295ec8-a165-45c3-85ff-b87127f61ffd) by 8637:3200 2024-10-31 16:42:16 to 2024-10-31 17:42:16 is PINNED on rw-uqbar-7:PinManager-387aeb6c-0462-4ba7-9dfb-5c5e176b2748
@DmitryLitvintsev DmitryLitvintsev self-assigned this Oct 31, 2024
DmitryLitvintsev added a commit that referenced this issue Nov 5, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
--------
Observe correct user specified pin lifetime.

Ticket: #7687
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes
Signed-off-by: Dmitry Litvintsev <[email protected]>
DmitryLitvintsev added a commit that referenced this issue Nov 6, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
-------
Observe correct user specified pin lifetime.

Ticket: #7687
Patch: https://rb.dcache.org/r/14339/
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes

Signed-off-by: Dmitry Litvintsev <[email protected]>
DmitryLitvintsev added a commit to DmitryLitvintsev/dcache that referenced this issue Nov 6, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
-------
Observe correct user specified pin lifetime.

Ticket: dCache#7687
Patch: https://rb.dcache.org/r/14339/
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes

Signed-off-by: Dmitry Litvintsev <[email protected]>
DmitryLitvintsev added a commit to DmitryLitvintsev/dcache that referenced this issue Nov 6, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
-------
Observe correct user specified pin lifetime.

Ticket: dCache#7687
Patch: https://rb.dcache.org/r/14339/
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes

Signed-off-by: Dmitry Litvintsev <[email protected]>
DmitryLitvintsev added a commit to DmitryLitvintsev/dcache that referenced this issue Nov 6, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
-------
Observe correct user specified pin lifetime.

Ticket: dCache#7687
Patch: https://rb.dcache.org/r/14339/
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes

Signed-off-by: Dmitry Litvintsev <[email protected]>
DmitryLitvintsev added a commit to DmitryLitvintsev/dcache that referenced this issue Nov 6, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
-------
Observe correct user specified pin lifetime.

Ticket: dCache#7687
Patch: https://rb.dcache.org/r/14339/
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes

Signed-off-by: Dmitry Litvintsev <[email protected]>
mksahakyan pushed a commit that referenced this issue Nov 7, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
-------
Observe correct user specified pin lifetime.

Ticket: #7687
Patch: https://rb.dcache.org/r/14339/
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes

Signed-off-by: Dmitry Litvintsev <[email protected]>
mksahakyan pushed a commit that referenced this issue Nov 7, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
-------
Observe correct user specified pin lifetime.

Ticket: #7687
Patch: https://rb.dcache.org/r/14339/
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes

Signed-off-by: Dmitry Litvintsev <[email protected]>
mksahakyan pushed a commit that referenced this issue Nov 7, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
-------
Observe correct user specified pin lifetime.

Ticket: #7687
Patch: https://rb.dcache.org/r/14339/
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes

Signed-off-by: Dmitry Litvintsev <[email protected]>
mksahakyan pushed a commit that referenced this issue Nov 11, 2024
Motivation:
-----------
Users reported 2 day pin lifetime on staged files (which is a default)
despite specifying different values. This is due to failure to match
target key on truncated vs prefixed path in target argument map keyed on
un-prefixed paths.

Modification:
-------------
Use full target paths throughout the system. Make sure to strip prefix
when exposing paths to users.

Result:
-------
Observe correct user specified pin lifetime.

Ticket: #7687
Patch: https://rb.dcache.org/r/14339/
Target: trunk
Request: 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes

Signed-off-by: Dmitry Litvintsev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant