Changes between Version 2 and Version 3 of BackendState


Ignore:
Timestamp:
Jul 21, 2007, 11:50:40 AM (17 years ago)
Author:
Nicolas
Comment:

Use headings instead of tables with inline HTML. Also use shorter anchors.

Legend:

Unmodified
Added
Removed
Modified
  • BackendState

    v2 v3  
     1[[PageOutline]]
    12= Workunit and result state transitions =
    23
    34The processing of workunits and results can be described in terms of transitions of their state variables.
    45
     6Workunit '''parameters''' are described [JobIn on a separate page].
    57
    6 == Workunit state variables ==
    7 Workunits parameters are described [JobIn here].
     8== Workunit state variables == #wu_states
    89
    9 Workunit state variables are as follows:
    10 
    11 {{{
    12 #!html
    13 <table border="1">
    14 <tr><td><b>canonical_resultid</b></td><td>
    15 }}}
     10=== `canonical_resultid` === #wu_canonical_resultid
    1611The ID of the canonical result for this workunit, or zero.
    1712 * Initially zero
    18  * Set by the validator (by check_set())
    19 {{{
    20 #!html
    21 </td></tr><tr><td><b>transition_time</b></td><td>
    22 }}}
     13 * Set by the validator (by `check_set()`)
     14
     15=== `transition_time` === #wu_transition_time
    2316The next time to check for state transitions for this WU.
    2417 * Initially now.
    2518 * Set to now by scheduler when get a result for this WU.
    26  * Set to min(current value, now + delay_bound) by scheduler     when send a result for this WU
    27  * Set to min(x.sent_time + wu.delay_bound) over IN_PROGRESS results x     by transitioner when done handling this WU
     19 * Set to min(current value, now + delay_bound) by scheduler when send a result for this WU
     20 * Set to min(x.sent_time + wu.delay_bound) over IN_PROGRESS results x by transitioner when done handling this WU
    2821 * Set to now by validator if it finds canonical result, or if there is already a canonical result and some other results have validate_state = INIT, or if there is no consensus and the number of successful results is > wu.max_success_results
    29 {{{
    30 #!html
    31 </td></tr><tr><td><b>file_delete_state</b></td><td>
    32 }}}
     22
     23=== `file_delete_state` === #wu_file_delete_state
    3324Indicates whether input files should be deleted.
    3425 * Initially INIT
    35  * Set to READY by transitioner when all results have server_state=OVER         and wu.assimilate_state=DONE Note: db_purge purges a WU and all its results when file_delete_state=DONE; therefore it is critical that it only be set to DONE if all results have server_state=OVER.
     26 * Set to READY by transitioner when all results have server_state=OVER and wu.assimilate_state=DONE Note: db_purge purges a WU and all its results when file_delete_state=DONE; therefore it is critical that it only be set to DONE if all results have server_state=OVER.
    3627 * Set to DONE by file_deleter when it has attempted to delete files.
    37 {{{
    38 #!html
    39 </td></tr><tr><td><b>assimilate_state</b></td><td>
    40 }}}
     28
     29=== `assimilate_state` === #wu_assimilate_state
    4130Indicates whether the workunit should be assimilated.
    4231 * Initially INIT
     
    4433 * Set to READY by validator when find canonical result and wu.assimilate_state=INIT
    4534 * Set to DONE by assimilator when done
    46 {{{
    47 #!html
    48 </td></tr><tr><td><b>need_validate</b></td><td>
    49 }}}
     35
     36=== `need_validate` === #wu_need_validate
    5037Indicates that the workunit has a result that needs validation.
    5138 * Initially FALSE
    52  * Set to TRUE by transitioner if the number of success results         is at least wu.min_quorum and there is a success result        not validated yet
     39 * Set to TRUE by transitioner if the number of success results is at least wu.min_quorum and there is a success result not validated yet
    5340 * Set to FALSE by validator
    54 {{{
    55 #!html
    56 </td></tr><tr><td><b>error_mask</b></td><td>
    57 }}}
     41
     42=== `error_mask` === #wu_error_mask
    5843A bit mask for error conditions.
    5944 * Initially zero
     
    6247 * Transitioner sets TOO_MANY_TOTAL_RESULTS if too many total results
    6348 * Validator sets TOO_MANY_SUCCESS_RESULTS if no consensus and too many success results
    64 {{{
    65 #!html
    66 </td></tr></table>
    67 }}}
    6849
    69 Workunit invariants:
     50=== Workunit invariants ===
    7051
    7152 * eventually either canonical_resultid or error_mask is set
     
    7354 * Each WU is assimilated exactly once
    7455
    75 Notes on deletion of input files:
     56=== Notes on deletion of input files ===
    7657
    7758 * Input files are eventually deleted, but only when all results have state=OVER (so that clients don't get download failures) and the WU has been assimilated (in case the project wants to examine input files in error cases).
    7859
    7960
    80 == Result state variable ==
     61== Result state variables ==
    8162
    82 Result state variables are listed in the following table:
    83 {{{
    84 #!html
    85 <table border="1">
    86 <tr><td><b>report_deadline</b></td><td>
    87 }}}
     63=== `report_deadline` === #result_report_deadline
    8864Give up on result (and possibly delete input files) if don't get reply by this time.
    8965 * Set by scheduler to now + wu.delay_bound when send result
    90 {{{
    91 #!html
    92 </td></tr><tr><td><b>server_state</b></td><td>
    93 }}}
     66
     67=== `server_state` === #result_server_state
    9468Values: UNSENT, IN_PROGRESS, OVER
    9569 * Initially UNSENT
    9670 * Set by scheduler to IN_PROGRESS when send result
    97  * Set by scheduler to OVER when result is reported         in request message from client.
    98  * Set by scheduler to OVER when it thinks         host has detached project.
     71 * Set by scheduler to OVER when result is reported in request message from client.
     72 * Set by scheduler to OVER when it thinks host has detached project.
    9973 * Set by transitioner to OVER if now > result.report_deadline
    100  * Set by transitioner to OVER if WU has error condition         and result.server_state=UNSENT
    101  * Set by validator to OVER if WU has canonical result         and result.server_state=UNSENT
    102 {{{
    103 #!html
    104 </td></tr><tr><td><b>outcome</b></td><td>
    105 }}}
     74 * Set by transitioner to OVER if WU has error condition and result.server_state=UNSENT
     75 * Set by validator to OVER if WU has canonical result and result.server_state=UNSENT
     76
     77=== `outcome` === #result_outcome
    10678Values: SUCCESS, COULDNT_SEND, CLIENT_ERROR, NO_REPLY, DIDNT_NEED, VALIDATE_ERROR, CLIENT_DETACHED. Defined iff result.server_state=OVER
    10779 * Set by scheduler to SUCCESS if get reply and no client error
     
    11385 * Set by validator to VALIDATE_ERROR if outcome was initially SUCCESS, but the validator had a permanent error reading a result file, or a file had a syntax error. Prevents the validator from trying again.
    11486 * Set by scheduler to CLIENT_DETACHED if it gets a request indicating that the client detached, then reattached
    115 {{{
    116 #!html
    117 </td></tr><tr><td><b>client_state</b></td><td>
    118 }}}
     87
     88=== `client_state` === #result_client_state
    11989Records the client state (DOWNLOADING, DOWNLOADED, COMPUTE_ERROR, UPLOADING, UPLOADED, ABORTED) where an error occurred. Defined if outcome is CLIENT_ERROR.
    120 {{{
    121 #!html
    122 </td></tr><tr><td><b>file_delete_state</b></td><td>
    123 }}}
     90
     91=== `file_delete_state` === #result_file_delete_state
    12492 * Initially INIT
    12593 * Set by transitioner to READY if this is the canonical result, and file_delete_state=INIT, and wu.assimilate_state=DONE, and all the results have server_state=OVER, and all all the results with outcome=SUCCESS have validate_state<>INIT
    12694 * Set by transitioner to READY if wu.assimilate_state=DONE and result.outcome=CLIENT_ERROR or result.validate_state!=INIT
    127 {{{
    128 #!html
    129 </td></tr><tr><td><b>validate_state</b></td><td>
    130 }}}
     95
     96=== `validate_state` === #result_validate_state
    13197Defined iff result.outcome=SUCCESS
    13298 * Initially INIT
     
    137103 * Set by validator to INCONCLUSIVE if check_set() didn't find a consensus in a set of results containing this one.
    138104 * Set by scheduler to TOO_LATE if the result was reported after the canonical result's files were deleted.
    139 {{{
    140 #!html
    141 </td></tr></table>
    142 }}}
    143 
    144 Result invariants:
    145105
    146106
    147  * Eventually server_state = OVER.
     107=== Result invariants ===
     108
     109 * Eventually [#result_server_state server_state] = OVER.
    148110 * Output files are eventually deleted.
    149111
    150 Notes on deletion of output files:
     112=== Notes on deletion of output files ===
    151113 * Non-canonical results can be deleted as soon as the WU is assimilated.
    152  * Canonical results can be deleted only when all results have server_state=OVER and all success results are validated.
     114 * Canonical results can be deleted only when all results have [#result_server_state server_state]=OVER and all success results are validated.
    153115 * If a result reply arrives after its timeout, the output files can be immediately deleted.
    154116