mirror of https://github.com/BOINC/boinc.git
- admin: add script for deleting results with no workunit.
There were ~1,400 of these on SETI@home, presumably because of a bug at some point in the past. svn path=/trunk/boinc/; revision=22197
This commit is contained in:
parent
f2221702bf
commit
b2064d0cd0
|
@ -5917,3 +5917,17 @@ Rom 11 Aug 2010
|
|||
|
||||
win_build/
|
||||
libboinc_staticcrt.vcproj
|
||||
|
||||
David 11 Aug 2010
|
||||
- admin: add script for deleting results with no workunit.
|
||||
There were ~1,400 of these on SETI@home,
|
||||
presumably because of a bug at some point in the past.
|
||||
html/
|
||||
ops/
|
||||
delete_orphan_results.php
|
||||
profile_screen_form.php
|
||||
inc/
|
||||
boinc_db.inc
|
||||
|
||||
sched/
|
||||
db_purge.cpp
|
||||
|
|
|
@ -223,6 +223,10 @@ class BoincResult {
|
|||
$db = BoincDb::get();
|
||||
return $db->lookup_id($id, 'result', 'BoincResult');
|
||||
}
|
||||
function delete() {
|
||||
$db = BoincDb::get();
|
||||
return $db->delete($this, 'result');
|
||||
}
|
||||
}
|
||||
|
||||
class BoincWorkunit {
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
// delete results without a corresponding workunit.
|
||||
// (in principle these shouldn't exist)
|
||||
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', true);
|
||||
ini_set('display_startup_errors', true);
|
||||
|
||||
require_once("../inc/boinc_db.inc");
|
||||
|
||||
$ndel = 0;
|
||||
while (1) {
|
||||
$rs = BoincResult::enum("true order by id limit 100");
|
||||
$found = false;
|
||||
foreach ($rs as $r) {
|
||||
$wu = BoincWorkunit::lookup_id($r->workunitid);
|
||||
if ($wu) {
|
||||
echo "$r->id has a WU\n";
|
||||
$found = true;
|
||||
break;
|
||||
} else {
|
||||
echo "$r->id has no WU - deleting\n";
|
||||
$ndel++;
|
||||
$r->delete();
|
||||
}
|
||||
}
|
||||
if ($found) break;
|
||||
}
|
||||
echo "Done - deleted $ndel results\n";
|
||||
|
||||
?>
|
|
@ -71,7 +71,7 @@ while ($profile = mysql_fetch_object($result)) {
|
|||
<br>
|
||||
";
|
||||
echo "</td><td><table border=2> ";
|
||||
show_profile($profile, $logged_in_user, true);
|
||||
show_profile($profile, $g_logged_in_user, true);
|
||||
echo "</table></td></tr>\n";
|
||||
echo "<input type=\"hidden\" name=\"userid$n\" value=\"$profile->userid\">\n";
|
||||
$n++;
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
// db_purge options
|
||||
//
|
||||
// purge workunit and result records that are no longer needed.
|
||||
// Specifically, purges WUs for which file_delete_state=DONE;
|
||||
// this occurs only when it has been assimilated
|
||||
// and all results have server_state=OVER.
|
||||
// Specifically, purges WUs for which file_delete_state=DONE.
|
||||
// Purging a WU means writing it and all its results
|
||||
// to XML-format archive files, then deleting it and its results from the DB.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue