-- ChristopheHaen - 2020-07-28

LHCb wants to reorder its namespace. The desired transformation is as follows (example at GridKa):

/pnfs/gridka.de/lhcb/dirA/dirB/file  -->  /pnfs/gridka.de/lhcb/SPACETOKEN/lhcb/dir-A/dir-B/file

To achieve that, Tigran has developed a script, which performs changes on the dCache chimera and spacemanager DBs. This script is available under this link: https://sas.desy.de/index.php/s/HjKc9dEzTgTe4S9

As requisite it is necessary to install java11 (part of EL7 distribution).

Steps

  • Before running Tigran's script, you need to update the chimera DB with an additional procedure:
CREATE OR REPLACE FUNCTION inumber2path(bigint, bigint) RETURNS varchar AS $$
DECLARE
     inumber bigint := $1;
     iroot bigint := $2;
     path    varchar := '';
     entry   record;
BEGIN
    IF iroot = inumber
    THEN
        return '/';
    END IF;

    LOOP
        IF iroot = inumber
        THEN
           EXIT;
        END IF;

        SELECT * INTO entry FROM t_dirs WHERE ichild = inumber;
        IF FOUND AND entry.iparent != inumber
        THEN
            path := '/' || entry.iname || path;
            inumber := entry.iparent;
        ELSE
            EXIT;
        END IF;
    END LOOP;

    RETURN path;
END;
$$
LANGUAGE 'plpgsql';

  • Second, in migration.properties you will need to point to corresponding databases and adapt the values of path.src and path.dest. Such values at GridKa:
# /src/dir-1/file -> /dest/TOKEN/dir-1/file
path.src = /pnfs/gridka.de/
path.dest = /pnfs/gridka.de/lhcb

  • Third (optional if you want to get rid of some space token), something similar to the following executed at GridKa will be necessary, adapting the values of the corresponding spacereservationid. It is also important to verify the values of vogroup, description in your instance.
   Execute the three SQL commands to get rid of LHCb_RAW.
[root@f01-117-104 ~]# psql spacemanager dcache
psql (11.8)
Type "help" for help.

spacemanager=> update srmspacefile set spacereservationid = 39930230 where spacereservationid = 449420;
UPDATE 29079
spacemanager=> delete from srmspace where id = 449420;
DELETE 1
spacemanager=> update srmspace set vogroup = '/lhcb',  description = 'LHCb-Tape' where id = 39930230;
UPDATE 1

  • Finally, execute:
$ java -jar lhcb-migration.jar [property-file]

If property file is not defined, then `migration.properties` from the local directory will be used.

Brave people can look at the code:

https://github.com/kofemann/lhcb-migration/blob/master/src/main/java/org/dcache/migraion/lhcb/Migration.java

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2020-07-28 - SamuelAmbrojPerezExternal
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback