IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Version 3 and Version 4 of shepherding_the_pstamp_server


Ignore:
Timestamp:
May 27, 2010, 3:16:30 PM (16 years ago)
Author:
bills
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • shepherding_the_pstamp_server

    v3 v4  
    1212
    1313Each file is represented in the database by a row in the table pstampRequest. The request starts
    14 life in state 'new'.
    15 
    16 Request files are parsed into jobs by the task pstamp.job.run
     14life in state 'new'. Once it is done parsing the state is set to 'run'. Request files are parsed into jobs by the task pstamp.job.run. The working directory for a request is /data/ippdb02.0/pstamp/work/$datestr/$req_id.
     15
     16For example here is the entry for a request while it is being parsed
     17
     18{{{
     19
     20
     21mysql> select * from pstampRequest where req_id = 5977;
     22+--------+-------+-------+------------------+---------+--------+---------------+---------------------------------------------------------+-------------------------------------------+-------+
     23| req_id | ds_id | state | name             | reqType | label  | outProduct    | uri                                                     | outdir                                    | fault |
     24+--------+-------+-------+------------------+---------+--------+---------------+---------------------------------------------------------+-------------------------------------------+-------+
     25|   5977 |     0 | new   | Niall.1274580688 | pstamp  | WEB.UP | pstampresults | /data/ippdb02.0/pstamp/work/20100527/5977/web_1695.fits | /data/ippdb02.0/pstamp/work/20100527/5977 |     0 |
     26+--------+-------+-------+------------------+---------+--------+---------------+---------------------------------------------------------+-------------------------------------------+-------+
     271 row in set (0.00 sec)
     28
     29
     30}}}
    1731
    1832Each row in the request table contains a request specification. Each row causes one or more pstampJobs to
    19 be entered into the database. Jobs can be entered with state = 'stop' and fault > 10. These are due
     33be entered into the database. Jobs are often entered with state = 'stop' and fault > 10. These are due
    2034to requests wanting images that haven't been destreaked or have been purged, bycoord requests that
    21 have no images or errors in the request.
     35have no images or errors in the request. The set of errors is listed at the bottom of this page.
    2236
    2337Once the file has completed parsing successfully it's state is set to 'run'. Once the request is
     
    2943The task pstamp.dependent.run runs the script pstamp_checkdependent.pl. This  script queries the
    3044gpc1 database for the state of the dependent component. This script's job is to queue and monitor
    31 update processing for the dependent component. CAREFUL THERE BE SPIDERS
     45update processing for the dependent component. CAREFUL. THERE BE SPIDERS!
     46
     47The log file for the dependent is stored in the file named "$pstampDependent->{outdir}/checkdep.$dep_id.log".
     48The script runs periodically, the log file is appended to each time. The outdir for the dependent is
     49the outdir of the first request that needs the component.
     50
     51Dependents can start being processed before parsing completes. The -pendingdependent query is
     52
     53
     54{{{
     55SELECT DISTINCT
     56    pstampDependent.*,
     57    IFNULL(Label.priority, 10000) AS priority
     58FROM pstampDependent
     59JOIN pstampJob USING(dep_id)
     60JOIN pstampRequest USING(req_id)
     61LEFT JOIN Label ON pstampRequest.label = Label.label
     62WHERE pstampDependent.state = 'new'
     63    AND pstampDependent.fault = 0
     64    AND pstampJob.state = 'run'
     65    AND (pstampRequest.state = 'run' OR pstampRequest.state = 'new')
     66    AND (Label.active OR Label.active IS NULL)
     67 ORDER BY priority DESC, req_id  LIMIT 1
     68
     69}}}
     70
    3271
    3372
     
    85124
    86125Jobs can fault due to typical nfs errors. There is a revert task for jobs. It only resets jobs with
    87 fault > 0 and < 10. Faults >= 10 are faults for the users. Jobs which are faulted in this way have
    88 shoul have had their state set to stop thus they are finished.
     126fault > 0 and < 10. Faults >= 10 are faults for the users. Jobs which are faulted in this way should
     127have had their state set to stop thus they are finished.
    89128
    90129The vast majority of the problems these days are related to the update processing. There are a large
    91 number of error conditions that can gum up the works. When a dependent run faults (that is when a
    92 update of a chipProcessedImfile, warpSkyfile, etc faults) the dependent is faulted as well.
    93 
     130number of error conditions that can gum up the works. W
    94131Here is an example
    95132
     
    119156is destreaked chipProcessedImfile.magicked > 0 it's done and the pstampDependent is set to 'full'
    120157
    121 The update processing is managed by the 'update' pantasks
    122 
    123 
    124 
    125 
    126 
    127 
     158The update processing is managed by the 'update' pantasks.
     159
     160When a dependent run faults (that is when a
     161update of a chipProcessedImfile, warpSkyfile, etc faults) the dependent is faulted as well. Thus to revert
     162the dependent one needs to revert the underlying failure first and then revert the dependent. This is not
     163yet done automatically.
     164
     165For example say the dependent listed above fails due to an nfs error. The chipProcessedImfile.fault should be
     166set to a PS_EXIT_SYS_ERROR (2). pstamp_checkdependent.pl will notice this and fault the dependent. It does this
     167to avoid faulted dependents from filling up the pantasks queue thus preventing other dependents from running.
     168
     169Once the chip fault has been cleared
     170
     171
     172
     173
     174== Postage Stamp Error Codes ==
     175
     176
     177{{{
     178
     179typedef enum {
     180        PSTAMP_SUCCESS          = 0,
     181        PSTAMP_FIRST_ERROR_CODE = 10,
     182        PSTAMP_SYSTEM_ERROR     = 10,
     183        PSTAMP_NOT_IMPLEMENTED  = 11,
     184        PSTAMP_UNKNOWN_ERROR    = 12,
     185        PSTAMP_DUP_REQUEST      = 20,
     186        PSTAMP_INVALID_REQUEST  = 21,
     187        PSTAMP_UNKNOWN_PRODUCT  = 22,
     188        PSTAMP_NO_IMAGE_MATCH   = 23,
     189        PSTAMP_NOT_DESTREAKED   = 24,
     190        PSTAMP_NOT_AVAILABLE    = 25,
     191        PSTAMP_GONE             = 26,
     192        PSTAMP_NO_JOBS_QUEUED   = 27,
     193        PSTAMP_NO_OVERLAP       = 28
     194} pstampJobErrors;
     195}}}
     196
     197
     198
     199
     200
     201
     202
     203