LFC Concept, Deployment and Usage  –  Best practices

 

1) LFC Concept

  • From the start, the LFC middleware was NOT designed to be a file system with distributed directory or distributed content.

  • It was designed and implemented as a lightweight catalog of LFNs (Logical File Names), each LFN having 1 or more SURLs.

  • In the BDII, LFC servers can have either the attribute 'central' or 'local'.  But this has absolutely NO impact on the fact that each LFC server with R/W access has its own namespace, and enforces uniqueness of LFNs only in its own namespace.

  • All SURLs belonging to one LFN are assumed to point to replicas, that is real SE files having SAME content.  But the LFC server :
    • is NOT notified by the SE whenever a real SE file is deleted, lost, or its content is modified,
    • does NOT perform any check on the validity and consistency of the SURLs that it has already stored.

  • In order to prevent too much inconsistency, each LFC server forbids, in its own namespace, to associate the same SURL to different LFNs.  But the LFC middleware does NOT prevent the same SURL to be associated to several LFNs, each LFN being on a different LFC server.

  • Thus, when any application receives from a LFC server the list of SURLs belonging to one LFN, it is the task of each application to check if the SE file pointed by one SURL really exists and has the adequate content.

  • Note:  A LFN can also be a symbolic link to another LFN, but that is not a issue.

 

2) Recommended Use Cases,  Best practices

  • Note :  Each lcg-XX command has a corresponding API for programmatic usage.

2.1) Deployment and usage of LFC servers by a VO

  • Each VO should use only 1 master LFC server with R/W access.
  • If desired, the VO can build a read-only distributed directory by using slave read-only LFC servers replicating the master LFC server with Oracle streams.

2.2) Registering a file in a LFC server

  • If the file is already on the adequate SE, use the 'lcg-rf' command.
  • If not, use the 'lcg-cr' command :  Consistency is improved by the fact that this command both copies the file content to the adequate SE and registers it in the LFC server.

2.3) Building distributed content by creating replicas

  • Use the 'lcg-rep' command :  Consistency is improved by the fact that this command both copies the file content to the adequate SE and registers it in the LFC server.

2.4) Making a local copy of a file

  • Use the 'lcg-lr' command to list all SURLs belonging to the LFN,
  • Try to copy the content of the file locally, using the 'lcg-cp' command with the preferred SURL as first parameter,
  • Verify the content of the local file,
  • In case of problem :
    • Log the problem so that the VO manager can trigger the adequate consistency check and corrective actions,
    • Try the next preferred SURL.

2.5) Reading the content of a file

Same principle as for 'making a local copy' :
  • Use the 'lcg-lr' command to list all SURLs belonging to the LFN,
  • Try to read the content of the file pointed by the preferred SURL,
  • Verify the content,
  • In case of problem :
    • Log the problem so that the VO manager can trigger the adequate consistency check and corrective actions,
    • Try the next preferred SURL.

2.6) Writing the content of a file

  • You can only write into a SE file, identified by its SURL.
  • Check if the SE file has known replicas, by using the 'lcg-lr' command with the SURL as first parameter (If the VO uses several LFC servers with R/W access, you have to do it for each LFC server).
  • If the SE file is not registered in the LFC server or has no other replica, you can write into it safely.
  • If the SE file has any other replica, STOP and think again :
    • Perhaps you should create a brand new SE file,
    • Perhaps you should first delete with the 'lcg-del' command all other replicas of this SE file, then write into it, then recreate replicas with the 'lcg-rep' command.

2.7) Deleting a single replica of a file

Use the 'lcg-del' command with the SURL as first parameter :  Consistency is improved by the fact that this command both deletes the file on the SE and unregisters it on the LFC server.

2.8) Deleting all replicas of a file

Use the 'lcg-del -a' command with the LFN as first parameter :  Consistency is improved by the fact that this command both deletes all SE files pointed by the SURLs belonging to the LFN and completely deletes the LFN.

2.9) Checking of the consistency between SURLs and SE files

  • It is advised that VO managers regularly use the logs of the problems mentioned above in order to check the consistency between problematic SURLs belonging to LFNs and real SE files.

  • The VO manager will then correct inconsistencies according to the VO policy.  For example :
    • For an absent SE file :  If another SE file having same content (replica) exists, use the 'lcg-cp' command with 2 SURLs as parameters to recreate it.
    • For an absent SE file :  If NO other SE file having same content (replica) exists, use the 'lcg-uf' command to destroy the corresponding SURL in the LFC server.
    • If the SE name has changed, or if massive renaming of SE files has been performed by a SE, look at https://twiki.cern.ch/twiki/bin/view/LCG/ChangeSeName
    • Request the help of the LFC support team.
 

LFC-Deployment-Usage-Recommended.png

 

3) Use Cases to be avoided   (On a grid, anything that CAN go wrong WILL go wrong)

3.1) Deployment and usage of LFC servers by a VO

  • A VO should avoid using several LFC servers with R/W access :  This can quickly lead to several LFNs having SURLs pointing to the same SE file, then massive file loss and data inconsistency.

3.2) Registering a file in a LFC server

  • Usage of the 'lcg-rf' command to register a SE file already registered in another LFC server :  This can quickly lead to file loss and data inconsistency.

  • Usage of the 'lcg-cp' command to copy the file content to a SE, then usage of the 'lcg-rf' command to register it :  Loss of connection with the SE just after copy, or any typing error in the SURL would create an inconsistency.  Instead, use the 'lcg-cr' command.

3.3) Making a local copy of a file

  • Usage of the 'lcg-cp' command with LFN a first parameter :  Results can be unpredictable.  Instead, use method described in chapter 2.4

3.4) Writing the content of a file

  • Direct writing of the content of any SE file registered in any LFC server as a SURL belonging to a LFN having more than 1 SURL (replica).  That immediately creates data inconsistency.  Instead, use method described in chapter 2.6

3.5) Deleting a single replica of a file

  • Direct destruction of the SE file, then usage of the 'lcg-uf' command to unregisters it on the LFC server :  Forgetting to use 'lcg-uf', or loss of connection with the SE just after destruction, or any typing error in the SURL would create an inconsistency.  Instead, use the 'lcg-del' command with the SURL as first parameter.

3.6) Deleting all replicas of a file

  • Direct destruction of all SE files, then usage of the 'lcg-uf' command to unregister them on the LFC server :  Forgetting to use 'lcg-uf' on any SURL, or loss of connection with any SE just after destruction, or any typing error in any SURL would create an inconsistency.  Instead, use the 'lcg-del -a' command with the LFN as first parameter.

LFC-Deployment-Usage-To-Be-Avoided.png

 

4) Other hints

  • TO BE VERIFIED :  Applications should use quite permanent LFNs, and should NOT continuously create and delete large numbers of LFNs used for a short time.  Reasons are :
    • That could put undue stress on the LFC server.
    • Creation of a LFN eats an 'internal file id' which is NOT reused by the LFC server, even after the LFN is deleted.

  • Even if the syntax of the 'lcg-aa' command is 'lcg-aa GUID LFN', the created LFN is NOT an alias pointing to the GUID, but a symbolic link pointing to the original LFN associated to the GUID.

 

LFC-Deployment-Usage.odg :  OpenOffice Source File for the Drawings

Page to be maintained by the LFC development team.

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2007-12-17 - EtienneUrbah
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LCG All webs login

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