Conditions Snapshots

Warning : on June 2004 new DB interface was introduced ( here), which takes OO_FD_BOOT from the configuration of farm. Managers do not need to specify it by hand anymore! Old interface still works, but new commands are much more safer. On Jul 2004 not all commands are tested yet (as marked). If you need to invoke any of these commands - please use new interface and if successfull - please, remove "not tested" mark.

The conditions need to be managed between the Master conditions federation, the PR and the ER farms.

The Master conditions federation is not used directly by any of the farms. It is a repository for all the conditions and rolling calibrations (RC). New constants that are loaded by hand (by sub-system experts) are loaded here and then transfered to the PC farms. When the RC are transfered from a PC to ER farm, the same snapshot must be loaded to the Master to keep it up to date.

More information about snapshot transfers could be found here.








Master To PC Conditions Transfer

Often when a subsystem needs to load new constants they are first written to the MASTER and then loaded to the relevant PC farms. The ER farms will get the updated conditions the next time they import a PC snapshot.

The conditions federation for the ER farms are meant to be mirror of the PC conditions. It is important to ensure that a given run is processed in both the PC and ER farm with the SAME conditions.

  1. After the expert has loaded the constants, take a snapshot of the Master federation
    Take the snapshot of the Master:
    new:(NOT TESTED) ../bin/$BFARCH/OprCmd.pl -nobjyserv03 -p 1602 -iCdb takeMasterSnapshot PCx
    old: ../bin/$BFARCH/OprCmd.pl -iCdb -nobjyserv03 -p1602 takeMasterSnapshot /nfs/objyserv05/objy/databases/production/conditions/master/BaBar.BOOT

  2. Suspend the PC farm:
    ../bin/$BFARCH/OprCmd.pl -iFarm,User -noprserv0x suspendfarm PC1
    This will tell the farm to stop after the current run is done being processed and go to sleep.
    Lock the PC farm:
    ../bin/$BFARCH/OprCmd.pl -iFarm,User -noprserv0x lockfarm PCx
    this will stop the farm from responding to any commands such as resumefarm until it is unlocked.

  3. Import the Master snapshot to the PC1 farm :
    new:(NOT TESTED) ../bin/$BFARCH/OprCmd.pl -nobjyserv03 -p 1602 -iCdb importMasterTo PCx
    old: ../bin/$BFARCH/OprCmd.pl -iCdb -nobjyserv03 -p1602 importMasterSnapshot /nfs/objyboot1/objy/databases/production/boot/physics/V4/slac/pc1/con001/BaBar.BOOT PC1

  4. You then need to update the view for the new constants which were loaded in the PC farm.
    The expert which did the loaded should have told you the name of the constants,
    e.g. /ifr/IfrDetectorConfigurationKeyP

    NOTE: EACH CONSTANT IS IN THE CDB TWICE, WITH A SLIGHTLY DIFFERENT NAME, once with a lower case and once with an upper case beginning of the sub-system name, e.g. /ifr/... and /Ifr/... YOU MUST COMPLETE THE FOLLOWING ACTION TWICE (as described below).

    For the action below you need to set OO_FD_BOOT path of PC1 farm correctly
    (setenv OO_FD_BOOT /nfs/objyboot1/objy/databases/production/boot/physics/V4/slac/pc1/con001/BaBar.BOOT)
    and invoke srtpath from RELEASE directory.
    1. Check the old view:
      CdbBrowser config /ifr/IfrDetectorConfigurationKeyP
      The REVISION-ID field gives the time (in BdbTime format) that the current view of the constants was updated.
      To convert to a readable time format do:
      BdbTimePrint
      choose 0
      paste in the numerical REVISION-ID

    2. Update the view to the newly loaded one:
      • For SVT local alignment :
        CdbManager copy_condition /svt/SvtPWaferAlign -input_view "MASTER::<recent>" /svt/SvtPWaferAlign -force
        This command will copy _configurations_ of SVT local alignment conditions from the most recent view of MASTER origin into the current origin of PC1. The "-force" switch is needed because the output condition already exists in PC1 CDB. Note also, that "<recent>" is a keyword. No substitute is required - type it as is. After the local view of PC1 to get exactly the same configuration as it's currently set up in MASTER CDB.
      • For other conditions :
        CdbManager autoconfigure_condition /ifr/IfrDetectorConfigurationKeyP NOW

    3. Make sure that the update worked:
      CdbBrowser config /ifr/IfrDetectorConfigurationKeyP
      BdbTimePrint
      choose 0
      paste in the numerical REVISION-ID
      This time should be the time when the expert loaded the new values to the Master (and be different than the time you got before you updated the view).

    4. Important: Repeat the same with a capital at the beginning of the sub-system name, e.g. /Ifr/... instead of /ifr/... (also for SVT local alignment)
      CdbBrowser config /Ifr/IfrDetectorConfigurationKeyP
      BdbTimePrint (This gives the old view time.)
      CdbManager copy_condition /Svt/SvtPWaferAlign -input_view "MASTER::<recent>" /Svt/SvtPWaferAlign -force
      ( or CdbManager autoconfigure_condition /Ifr/IfrDetectorConfigurationKeyP NOW)
      CdbBrowser config /Ifr/IfrDetectorConfigurationKeyP
      BdbTimePrint (This gives the new view time, make sure that it is correct.)

  5. Unlock the PC farm:
    ../bin/$BFARCH/OprCmd.pl -iFarm,User -noprserv0x unlockfarm PCx
    Resume the PC farm:
    ../bin/$BFARCH/OprCmd.pl -iFarm,User -noprserv0x resumefarm PCx

  6. Post to OPRsos-hn that you have loaded these constants to the PC farm, cc the expert that did the loading and cc the DB expert involved. Note the first run (with the explicit rundir path) that used the new constants and ask the expert to check, if possible, that they are there and working as expected. Also add OO_FD_BOOT settings, in case they can check the contents of the database directly.



How to restart Snapshot Daemon in Padova
The snapshot daemon acts as an interface for the ER farms to load the most recent conditions snapshot. to restart the snapshot daemon in Padova

More on Constant Loading and Views

what needs to be done for SP
Last modified: Sat Jul 3 13:40:48 PDT 2004 by Olya Igonkina