| | 1 | Shepherding the postage stamp server and the update process. |
| | 2 | |
| | 3 | Overview |
| | 4 | -------- |
| | 5 | |
| | 6 | Postage stamp request files are fits tables that contain 1 or more request specifications. |
| | 7 | Request 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 | |
| | 12 | Each file is represented in the database by a row in the table pstampRequest. The request starts |
| | 13 | life in state 'new'. |
| | 14 | |
| | 15 | Request files are parsed into jobs by the task pstamp.job.run |
| | 16 | |
| | 17 | Each row in the request table contains a request specification. Each row causes one or more pstampJobs to |
| | 18 | be entered into the database. Jobs can be entered with state = 'stop' and fault > 10. These are due |
| | 19 | to requests wanting images that haven't been destreaked or have been purged, bycoord requests that |
| | 20 | have no images or errors in the request. |
| | 21 | |
| | 22 | Once the file has completed parsing successfully it's state is set to 'run'. Once the request is |
| | 23 | in state run its jobs are eligible to run and will be output by pstamptool -pendingjob |
| | 24 | |
| | 25 | If a pstampJob's input images have been cleaned a pstampDependent object is entered into the |
| | 26 | database with state 'new'. The pstampJob will not be run until it's dependent is set to 'full'. |
| | 27 | |
| | 28 | The task pstamp.dependent.run runs the script pstamp_checkdependent.pl. This script queries the |
| | 29 | gpc1 database for the state of the dependent component. This script's job is to queue and monitor |
| | 30 | update processing for the dependent component. CAREFUL THERE BE SPIDERS |
| | 31 | |
| | 32 | |
| | 33 | Once all jobs have completed (changed from run to stop state) the request is queued for "finishing". |
| | 34 | The task pstamp.finish.run builds the results fits table and packages up all of the data into |
| | 35 | a fileset on the request's outgoing data store. |
| | 36 | |
| | 37 | |
| | 38 | Monitoring |
| | 39 | ---------- |
| | 40 | |
| | 41 | Since the postage stamp / data store database is on ippdb02 and not ippdb01 |
| | 42 | some care must be taken when running commands. |
| | 43 | |
| | 44 | I define the environment variable PSDBSERVER=ippdb02 and the alias |
| | 45 | |
| | 46 | |
| | 47 | {{{ |
| | 48 | alias pst 'pstamptool -dbname ippRequestServer -dbserver $PSDBSERVER' |
| | 49 | |
| | 50 | }}} |
| | 51 | |
| | 52 | I always type pst instead of pstamptool. Since the postage stamp tables |
| | 53 | on 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 | |
| | 69 | This is a feature. (I plan on removing the postage stamp tables from the set created by pxadmin -create |
| | 70 | and adding a new mode to create them but I haven't gotten around to it yet). |
| | 71 | |
| | 72 | |
| | 73 | |
| | 74 | Common Failures |
| | 75 | --------------- |
| | 76 | Requests can fault for two reasons either at the parse stage or when finishing the request. Request |
| | 77 | faults rarely happen and are usually due to software bug. pst -revertreq doesn't work for requests that |
| | 78 | haven't finished parsing. (The script sets the state to run when it shouldn't. I don't want to fix this |
| | 79 | problem until I'm sure that it won't break anything). |
| | 80 | |
| | 81 | Jobs can fault due to typical nfs errors. There is a revert task for jobs. It only resets jobs with |
| | 82 | fault > 0 and < 10. Faults >= 10 are faults for the users. Jobs which are faulted in this way have |
| | 83 | shoul have had their state set to stop thus they are finished. |
| | 84 | |
| | 85 | The vast majority of the problems these days are related to the update processing. There are a large |
| | 86 | number of error conditions that can gum up the works. When a dependent run faults (that is when a |
| | 87 | update of a chipProcessedImfile, warpSkyfile, etc faults) the dependent is faulted as well. |
| | 88 | |
| | 89 | Here is an example |
| | 90 | |
| | 91 | (ipp032:~) bills% pst -pendingdependent -limit 1 |
| | 92 | pstampDependent MULTI |
| | 93 | |
| | 94 | pstampDependent 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 |
| | 106 | END |
| | 107 | |
| | 108 | pstamp_checkdependent.pl sets chipRun 77563, class_id XY31 to update state and watches for it to |
| | 109 | go to 'full' state. Once it' goes to full it sets the magicDSRun to 'new' state. Once the component |
| | 110 | is destreaked chipProcessedImfile.magicked > 0 it's done and the pstampDependent is set to 'full' |
| | 111 | |
| | 112 | The update processing is managed by the 'update' pantasks |
| | 113 | |
| | 114 | |
| | 115 | |
| | 116 | |
| | 117 | |
| | 118 | |