IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30544


Ignore:
Timestamp:
Feb 9, 2011, 11:34:09 AM (15 years ago)
Author:
bills
Message:

Add special fault code PXTOOL_DO_NOT_REVERT_FAULT (value is equal to PSTAMP_GONE (26).
Components with this fault will not be reverted during update processing and will not be set to update
once cleaned.
When setting warps and diffs to be updated clear fault. chip and destreak already do this.
Deleted some code that is no longer used.

Location:
trunk/ippTools
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/difftool_pendingcleanupskyfile.sql

    r24186 r30544  
    99    USING(diff_id)
    1010WHERE
    11    ((diffRun.state = 'goto_cleaned'  AND diffSkyfile.data_state = 'full')
     11   ((diffRun.state = 'goto_cleaned'  AND (diffSkyfile.data_state = 'full' OR diffSkyfile.data_state = 'update'))
    1212    OR
    1313    (diffRun.state = 'goto_scrubbed' AND diffSkyfile.data_state != 'scrubbed')
  • trunk/ippTools/share/difftool_setskyfiletoupdate.sql

    r29568 r30544  
    11UPDATE diffRun
    22    JOIN diffSkyfile USING(diff_id)
    3     LEFT JOIN magicDSRun ON (stage_id = diff_id AND stage = 'diff')
    4     LEFT JOIN magicDSFile ON (magicDSRun.magic_ds_id = magicDSFile.magic_ds_id
    5                               AND component = skycell_id)
    63SET diffRun.state = 'update',
    7     diffSkyfile.data_state = 'update'
     4    diffSkyfile.data_state = 'update',
     5    diffSkyfile.fault = 0
    86    -- set hook %s
    97WHERE diff_id = %lld
    108    AND (diffRun.state = 'cleaned' OR diffRun.state = 'update')
    11     AND (diffSkyfile.data_state = 'cleaned')
     9    AND (diffSkyfile.data_state = 'cleaned' AND diffSkyfile.data_state = 'update')
  • trunk/ippTools/share/magicdstool_setfiletoupdate.sql

    r29561 r30544  
    77WHERE magic_ds_id = %lld
    88    AND (magicDSRun.state = 'cleaned' OR magicDSRun.state = 'update')
    9     AND (magicDSFile.data_state = 'cleaned')
     9    AND (magicDSFile.data_state = 'cleaned' OR magicDSFile.data_state ='update')
  • trunk/ippTools/share/warptool_setskyfiletoupdate.sql

    r29568 r30544  
    11UPDATE warpRun
    22    JOIN warpSkyfile USING(warp_id)
    3     LEFT JOIN magicDSRun ON (stage_id = warp_id AND stage = 'warp')
    4     LEFT JOIN magicDSFile ON (magicDSRun.magic_ds_id = magicDSFile.magic_ds_id
    5                               AND component = skycell_id)
    63SET warpRun.state = 'update',
    7     warpSkyfile.data_state = 'update'
     4    warpSkyfile.data_state = 'update',
     5    warpSkyfile.fault = 0
    86    -- set hook %s
    97WHERE warp_id = %lld
    108    AND (warpRun.state = 'cleaned' OR warpRun.state = 'update')
    11     AND (warpSkyfile.data_state = 'cleaned')
     9    AND (warpSkyfile.data_state = 'cleaned' OR warpSkyfile.data_state = 'update')
  • trunk/ippTools/src/chiptool.c

    r30049 r30544  
    838838    PXOPT_COPY_S16(config->args, where, "-fault", "chipProcessedImfile.fault", "==");
    839839
     840    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     841
    840842    if (!psListLength(where->list)
    841843        && !psMetadataLookupBool(NULL, config->args, "-all")) {
     
    874876    }
    875877    psFree(query);
     878
     879    if (!fault) {
     880        // If fault has not been supplied, don't revert update faults with the magic value
     881        // We don't do this for new runs because then they would never complete
     882        // quality should be used to drop bad components
     883        psStringAppend(&query_update, " AND (chipProcessedImfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
     884    }
    876885    if (!p_psDBRunQuery(config->dbh, query_update)) {
    877886        psError(PS_ERR_UNKNOWN, false, "database error");
     
    19191928    }
    19201929
     1930    // we do not update components with the magic fault value. They are non-updateable
     1931    psStringAppend(&query, " AND (chipProcessedImfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
     1932
    19211933    if (!p_psDBRunQueryF(config->dbh, query, setHook, chip_id)) {
    19221934        psError(PS_ERR_UNKNOWN, false, "database error");
  • trunk/ippTools/src/difftool.c

    r30070 r30544  
    917917    PXOPT_COPY_S16(config->args, where, "-fault",     "fault", "==");
    918918
     919    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     920
    919921    if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) {
    920922        psFree(where);
     
    950952        psLogMsg("difftool", PS_LOG_INFO, "Deleted %" PRIu64 " rows", psDBAffectedRows(config->dbh));
    951953
     954        if (!fault) {
     955            // If fault has not been supplied, don't revert update faults with the magic value
     956            // We don't do this for new runs because then they would never complete
     957            // quality should be used to drop bad components
     958            psStringAppend(&query_updated, " AND (diffSkyfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
     959        }
    952960        if (!p_psDBRunQuery(config->dbh, query_updated)) {
    953961            psError(PS_ERR_UNKNOWN, false, "database error");
     
    31983206        psStringAppend(&query, " AND (diffSkyfile.skycell_id = '%s')", skycell_id);
    31993207    }
     3208    // we do not update components with the magic fault value. They are non-updateable
     3209    // (But can be recovered with "difftool -revertwarped -fault 26" (PXTOOL_DO_NOT_REVERT_FAULT)
     3210    psStringAppend(&query, " AND (diffSkyfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
    32003211
    32013212    if (!p_psDBRunQueryF(config->dbh, query, setHook, diff_id)) {
  • trunk/ippTools/src/magicdstool.c

    r30313 r30544  
    11121112
    11131113    PXOPT_LOOKUP_STR(state, config->args, "-state", false, false);
     1114    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
    11141115
    11151116    psString queryFile = NULL;
     1117    bool stateIsUpdate = false;
    11161118    if (state) {
    11171119        if (! strcmp(state, "new") || !strcmp(state, "goto_restored")) {
     
    11191121        } else if (!strcmp(state, "update")) {
    11201122            queryFile = "magicdstool_revertupdated.sql";
     1123            stateIsUpdate = true;
    11211124        } else {
    11221125            psError(PXTOOLS_ERR_SYS, true, "%s is not a valid value for state", state);
     
    11411144    }
    11421145    psFree(where);
     1146
     1147    if (stateIsUpdate && !fault) {
     1148        // If fault has not been supplied, don't revert update faults with
     1149        // the magic "do not update" value
     1150        // We don't do this for new runs because then they would never complete
     1151        // quality should be used to drop bad components
     1152        psStringAppend(&query, " AND magicDSFile.fault != %d", PXTOOL_DO_NOT_REVERT_FAULT);
     1153    }
    11431154
    11441155    if (!p_psDBRunQuery(config->dbh, query)) {
     
    17441755    }
    17451756
     1757    // we do not update components with the magic fault value. They are non-updateable
     1758    // (But can be recovered with "magicdstool -revertdestreakedfile -fault 26" (PXTOOL_DO_NOT_REVERT_FAULT)
     1759    psStringAppend(&query, " AND (fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
     1760
    17461761    if (!p_psDBRunQueryF(config->dbh, query, setHook, magic_ds_id)) {
    17471762        psError(PS_ERR_UNKNOWN, false, "database error");
  • trunk/ippTools/src/pxtools.h

    r28486 r30544  
    5151# define MAX_ROWS 10e9
    5252# define PXTOOL_MODE_NONE 0x0
     53// we do not revert or update components with this fault value
     54// This is the same value as PSTAMP_GONE
     55# define PXTOOL_DO_NOT_REVERT_FAULT 26
    5356
    5457bool pxIsValidState(const char *state);
  • trunk/ippTools/src/warptool.c

    r29903 r30544  
    14851485    PXOPT_COPY_S16(config->args, where, "-fault",      "warpSkyfile.fault", "==");
    14861486
     1487    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     1488
    14871489    if (!psListLength(where->list)
    14881490        && !psMetadataLookupBool(NULL, config->args, "-all")) {
     
    15101512    }
    15111513    psFree(where);
     1514
     1515    if (!fault) {
     1516        // If fault has not been supplied, don't revert update faults with the magic value
     1517        // We don't do this for new runs because then they would never complete
     1518        // quality should be used to drop bad components
     1519        psStringAppend(&query_updated, " AND fault != %d", PXTOOL_DO_NOT_REVERT_FAULT);
     1520    }
    15121521
    15131522    if (!p_psDBRunQuery(config->dbh, query)) {
     
    20032012// shared code for the modes -tocleanedskyfile -tofullskyfile -topurgedskyfile
    20042013
    2005 static bool change_skyfile_data_state(pxConfig *config, psString data_state, psString run_state)
     2014static bool change_skyfile_data_state(pxConfig *config, psString data_state)
    20062015{
    20072016    PS_ASSERT_PTR_NON_NULL(config, false);
     
    20652074static bool tocleanedskyfileMode(pxConfig *config)
    20662075{
    2067     return change_skyfile_data_state(config, "cleaned", "goto_cleaned");
     2076    return change_skyfile_data_state(config, "cleaned");
    20682077}
    20692078static bool tofullskyfileMode(pxConfig *config)
    20702079{
    2071     return change_skyfile_data_state(config, "full", "update");
     2080    return change_skyfile_data_state(config, "full");
    20722081}
    20732082static bool topurgedskyfileMode(pxConfig *config)
    20742083{
    2075     return change_skyfile_data_state(config, "purged", "goto_purged");
     2084    return change_skyfile_data_state(config, "purged");
    20762085}
    20772086static bool toscrubbedskyfileMode(pxConfig *config)
    20782087{
    2079      return change_skyfile_data_state(config, "scrubbed", "goto_scrubbed");
     2088     return change_skyfile_data_state(config, "scrubbed");
    20802089}
    20812090
     
    21012110    else {
    21022111      if (strcmp(state,"error_cleaned") == 0) {
    2103         change_skyfile_data_state(config,"error_cleaned","goto_cleaned");
     2112        change_skyfile_data_state(config,"error_cleaned");
    21042113      }
    21052114      else if (strcmp(state, "error_scrubbed") == 0) {
    2106         change_skyfile_data_state(config,"error_scrubbed","goto_scrubbed");
     2115        change_skyfile_data_state(config,"error_scrubbed");
    21072116      }
    21082117      else if (strcmp(state, "error_purged") == 0) {
    2109         change_skyfile_data_state(config,"error_purged","goto_purged");
     2118        change_skyfile_data_state(config,"error_purged");
    21102119      }
    21112120      else {
     
    25262535        psStringAppend(&query, " AND (warpSkyfile.skycell_id = '%s')", skycell_id);
    25272536    }
     2537    // we do not update components with the magic fault value. They are non-updateable
     2538    // (But can be recovered with "warptool -revertwarped -fault 26" (PXTOOL_DO_NOT_REVERT_FAULT)
     2539    psStringAppend(&query, " AND (warpSkyfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
    25282540
    25292541    if (!p_psDBRunQueryF(config->dbh, query, setHook, warp_id)) {
Note: See TracChangeset for help on using the changeset viewer.