IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of shepherding_the_pstamp_server


Ignore:
Timestamp:
May 27, 2010, 2:33:20 PM (16 years ago)
Author:
bills
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • shepherding_the_pstamp_server

    v1 v1  
     1Shepherding the postage stamp server and the update process.
     2
     3Overview
     4--------
     5
     6Postage stamp request files are fits tables that contain 1 or more request specifications.
     7Request files are submitted to the system three ways.
     8    * By posting to a fileset on a data store that the server is monitoring
     9    * by uploading a request file to the upload page http://pstamp.ipp.ifa.hawaii.edu/upload.php
     10    * by entering a "valid" set of paramters on the prototype web interface and hitting submit
     11
     12Each file is represented in the database by a row in the table pstampRequest. The request starts
     13life in state 'new'.
     14
     15Request files are parsed into jobs by the task pstamp.job.run
     16
     17Each row in the request table contains a request specification. Each row causes one or more pstampJobs to
     18be entered into the database. Jobs can be entered with state = 'stop' and fault > 10. These are due
     19to requests wanting images that haven't been destreaked or have been purged, bycoord requests that
     20have no images or errors in the request.
     21
     22Once the file has completed parsing successfully it's state is set to 'run'. Once the request is
     23in state run its jobs are eligible to run and will be output by pstamptool -pendingjob
     24
     25If a pstampJob's input images have been cleaned a pstampDependent object is entered into the
     26database with state 'new'. The pstampJob will not be run until it's dependent is set to 'full'.
     27
     28The task pstamp.dependent.run runs the script pstamp_checkdependent.pl. This  script queries the
     29gpc1 database for the state of the dependent component. This script's job is to queue and monitor
     30update processing for the dependent component. CAREFUL THERE BE SPIDERS
     31
     32
     33Once all jobs have completed (changed from run to stop state) the request is queued for "finishing".
     34The task pstamp.finish.run builds the results fits table and packages up all of the data into
     35a fileset on the request's outgoing data store.
     36
     37
     38Monitoring
     39----------
     40
     41Since the postage stamp / data store database is on ippdb02 and not ippdb01
     42some care must be taken when running commands.
     43
     44I define the environment variable PSDBSERVER=ippdb02 and the alias
     45
     46 
     47{{{
     48   alias pst 'pstamptool -dbname ippRequestServer -dbserver $PSDBSERVER'
     49
     50}}}
     51
     52I always type pst instead of pstamptool. Since the postage stamp tables
     53on gpc1 database have been dropped you get errors if you try and run pstamptool without -dbserver
     54
     55
     56{{{
     57    (ipp032:~) bills% pstamptool -pendingreq
     58     p_psDBRunQuery (psDB.c:812) : Failed to execute SQL query.  Error: Table 'gpc1.pstampRequest' doesn't exist
     59         pendingreqMode (pstamptool.c:320) : database error
     60
     61
     62     -> p_psDBRunQuery (psDB.c:812): Database error generated by the server
     63         Failed to execute SQL query.  Error: Table 'gpc1.pstampRequest' doesn't exist
     64     -> pendingreqMode (pstamptool.c:320): unknown psLib error
     65         database error
     66
     67}}}
     68
     69This is a feature. (I plan on removing the postage stamp tables from the set created by pxadmin -create
     70and adding a new mode to create them but I haven't gotten around to it yet).
     71
     72
     73
     74Common Failures
     75---------------
     76Requests can fault for two reasons either at the parse stage or when finishing the request. Request
     77faults rarely happen and are usually due to software bug. pst -revertreq doesn't work for requests that
     78haven't finished parsing. (The script sets the state to run when it shouldn't. I don't want to fix this
     79problem until I'm sure that it won't break anything).
     80
     81Jobs can fault due to typical nfs errors. There is a revert task for jobs. It only resets jobs with
     82fault > 0 and < 10. Faults >= 10 are faults for the users. Jobs which are faulted in this way have
     83shoul have had their state set to stop thus they are finished.
     84
     85The vast majority of the problems these days are related to the update processing. There are a large
     86number of error conditions that can gum up the works. When a dependent run faults (that is when a
     87update of a chipProcessedImfile, warpSkyfile, etc faults) the dependent is faulted as well.
     88
     89Here is an example
     90
     91(ipp032:~) bills% pst -pendingdependent -limit 1
     92pstampDependent MULTI
     93
     94pstampDependent  METADATA 
     95   dep_id           S64       55261         
     96   state            STR       new             
     97   stage            STR       chip           
     98   stage_id         S64       77563         
     99   component        STR       XY31           
     100   imagedb          STR       gpc1           
     101   outdir           STR       /data/ippdb02.0/pstamp/work/20100527/5977
     102   rlabel           STR       ps_ud_WEB.UP   
     103   need_magic       BOOL      T             
     104   fault            S16       0             
     105   priority         S64       8             
     106END
     107
     108pstamp_checkdependent.pl sets chipRun 77563, class_id XY31 to update state and watches for it to
     109go to 'full' state. Once it' goes to full it sets the magicDSRun to 'new' state. Once the component
     110is destreaked chipProcessedImfile.magicked > 0 it's done and the pstampDependent is set to 'full'
     111
     112The update processing is managed by the 'update' pantasks
     113
     114
     115
     116
     117
     118