server: more fixes to DB to handle unsigned result IDs

svn path=/trunk/boinc/; revision=24564
This commit is contained in:
Jeff Cobb 2011-11-09 20:24:48 +00:00
parent 22a911516c
commit 2e526a0956
6 changed files with 20 additions and 10 deletions

View File

@ -8300,8 +8300,19 @@ Rom 9 Nov 2011
clientscr/
screensaver_win.cpp
David 10 Nov 2011
David 9 Nov 2011
- server: more fixes to DB to handle unsigned result IDs
db/
boinc_db.cpp
Jeff 9 Nov 2011
- server: more fixes to DB to handle unsigned result IDs
sched/
feeder.cpp
sched_shmem.cpp
db_purge.cpp
sched_assign.cpp
lib/
parse.cpp

View File

@ -63,7 +63,6 @@ using std::string;
bool parse_bool(const char* buf, const char* tag, bool& result) {
char tag2[256], tag3[256];
int x;
// quick check to reject most cases
//
if (!strstr(buf, tag)) {

View File

@ -371,7 +371,7 @@ int archive_wu(DB_WORKUNIT& wu) {
" <rsc_memory_bound>%.15e</rsc_memory_bound>\n"
" <rsc_disk_bound>%.15e</rsc_disk_bound>\n"
" <need_validate>%d</need_validate>\n"
" <canonical_resultid>%d</canonical_resultid>\n"
" <canonical_resultid>%u</canonical_resultid>\n"
" <canonical_credit>%.15e</canonical_credit>\n"
" <transition_time>%d</transition_time>\n"
" <delay_bound>%d</delay_bound>\n"

View File

@ -301,7 +301,7 @@ static bool get_job_from_db(
if (!ssp->lookup_app(wi.wu.appid)) {
#if 0
log_messages.printf(MSG_CRITICAL,
"result [RESULT#%d] has bad appid %d; clean up your DB!\n",
"result [RESULT#%u] has bad appid %d; clean up your DB!\n",
wi.res_id, wi.wu.appid
);
#endif
@ -326,7 +326,7 @@ static bool get_job_from_db(
ncollisions++;
collision = true;
log_messages.printf(MSG_DEBUG,
"result [RESULT#%d] already in array\n", wi.res_id
"result [RESULT#%u] already in array\n", wi.res_id
);
break;
}
@ -340,7 +340,7 @@ static bool get_job_from_db(
if (hrt) {
if (!hr_info.accept(hrt, wi.wu.hr_class)) {
log_messages.printf(MSG_DEBUG,
"rejecting [RESULT#%d] because HR class %d/%d over quota\n",
"rejecting [RESULT#%u] because HR class %d/%d over quota\n",
wi.res_id, hrt, wi.wu.hr_class
);
continue;
@ -459,7 +459,7 @@ static bool scan_work_array(vector<DB_WORK_ITEM> &work_items) {
);
if (found) {
log_messages.printf(MSG_NORMAL,
"adding result [RESULT#%d] in slot %d\n",
"adding result [RESULT#%u] in slot %d\n",
wi.res_id, i
);
wu_result.resultid = wi.res_id;

View File

@ -96,7 +96,7 @@ static int send_assigned_job(ASSIGNMENT& asg) {
if (!asg.multi && asg.target_type!=ASSIGN_NONE) {
DB_ASSIGNMENT db_asg;
db_asg.id = asg.id;
sprintf(buf, "resultid=%d", result_id);
sprintf(buf, "resultid=%u", result_id);
retval = db_asg.update_field(buf);
if (retval) {
log_messages.printf(MSG_CRITICAL,

View File

@ -292,7 +292,7 @@ void SCHED_SHMEM::show(FILE* f) {
WU_RESULT& wu_result = wu_results[i];
switch(wu_result.state) {
case WR_STATE_PRESENT:
fprintf(f, "%4d: ap %d ic %d wu %d rs %d hr %d nr %d\n",
fprintf(f, "%4d: ap %d ic %d wu %d rs %u hr %d nr %d\n",
i, wu_result.workunit.appid, wu_result.infeasible_count,
wu_result.workunit.id, wu_result.resultid,
wu_result.workunit.hr_class, wu_result.need_reliable
@ -302,7 +302,7 @@ void SCHED_SHMEM::show(FILE* f) {
fprintf(f, "%4d: ---\n", i);
break;
default:
fprintf(f, "%4d: PID %d: result %d\n", i, wu_result.state, wu_result.resultid);
fprintf(f, "%4d: PID %d: result %u\n", i, wu_result.state, wu_result.resultid);
}
}
}