#989 closed defect (fixed)
Query to detect completed chip run is tautological
| Reported by: | Paul Price | Owned by: | jhoblitt |
|---|---|---|---|
| Priority: | highest | Milestone: | |
| Component: | ippTools | Version: | unspecified |
| Severity: | major | Keywords: | VERIFIED |
| Cc: |
Description
"chiptool -addprocessedimfile", after adding the processed imfile, checks to see if the exposure is complete, using the SQL in chiptool_completely_processed_exp.sql However, this seems to always return a line, regardless of how many imfiles have been processed. Here's a demonstration using database 'gpctest':
mysql> select count(class_id) from rawImfile where exp_id = 450; +-----------------+
| count(class_id) |
+-----------------+
| 60 |
+-----------------+
1 row in set (0.00 sec)
mysql> select count(class_id) from chipProcessedImfile where exp_id = 450;
+-----------------+
| count(class_id) |
+-----------------+
| 20 |
+-----------------+
1 row in set (0.00 sec)
### This is the essence of the query in chiptool_completely_processed_exp.sql:
mysql> SELECT
-> chipRun.*,
-> rawImfile.class_id as rawimfile_class_id,
-> chipProcessedImfile.class_id
-> FROM chipRun
-> JOIN rawImfile
-> USING(exp_id)
-> LEFT JOIN chipProcessedImfile
-> ON chipRun.chip_id = chipProcessedImfile.chip_id
-> AND rawImfile.exp_id = chipProcessedImfile.exp_id
-> AND rawImfile.class_id = chipProcessedImfile.class_id
-> WHERE
-> chipRun.state = 'run'
-> AND chipProcessedImfile.fault = 0
-> GROUP BY
-> chipRun.chip_id,
-> chipRun.exp_id
-> HAVING COUNT(rawImfile.class_id) = COUNT(chipProcessedImfile.class_id);
+---------+--------+-------+------------------+---------------+-------+-----------+----------+-------+--------------------+----------+
| chip_id | exp_id | state | workdir | workdir_state | label | reduction | expgroup | dvodb | rawimfile_class_id | class_id |
+---------+--------+-------+------------------+---------------+-------+-----------+----------+-------+--------------------+----------+
| 450 | 450 | run | path://GPC1/pap/ | dirty | NULL | OVERSCAN | NULL | NULL | XY01 | XY01 |
+---------+--------+-------+------------------+---------------+-------+-----------+----------+-------+--------------------+----------+
1 row in set (0.01 sec)
This prevents us from processing a full GPC exposure. Not sure why we haven't noticed it from running MegaCam. I expect I only got 20 processed imfiles through because pantasks takes 20 imfiles at a time, so the first triggered the completed chipRun, and the other 19 ran anyway and then added themselves as processed.
Change History (2)
comment:1 by , 19 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 19 years ago
| Keywords: | VERIFIED added |
|---|
This fix seems to be running through quite nicely.
mysql> select count(class_id) from rawImfile where exp_id = 370;
+-----------------+
| count(class_id) |
+-----------------+
| 60 |
+-----------------+
1 row in set (0.00 sec)
mysql> select count(class_id) from chipProcessedImfile where exp_id = 370; +-----------------+
| count(class_id) |
+-----------------+
| 60 |
+-----------------+
1 row in set (0.01 sec)

The problem was fairly subtle but I think I've commited a fix. Please re-run the data and let me know if there is a problem
diff -u -p -r1.7 chiptool_completely_processed_exp.sql
--- chiptool_completely_processed_exp.sql 7 Jul 2007 03:41:50 -0000 1.7
+++ chiptool_completely_processed_exp.sql 24 Oct 2007 21:34:16 -0000
@@ -23,7 +23,7 @@ FROM