Merge pull request #2138 from bema-aei/validate_suspicious_results

validator: raise the quorum for 'suspicious' results to ensure validation
This commit is contained in:
Christian Beer 2019-02-16 16:39:11 +01:00 committed by GitHub
commit 16e7c516d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -116,6 +116,16 @@ int check_set(
good_results += suspicious_results;
}
// if there are "suspicious" results and min_quorum < g_app->target_nresults
// (i.e. adaptive replication), raise min_quorum to g_app->target_nresults
// the abs() is there for Einstein@Home-specific use of app->target_nresults,
// please leave it in there.
//
if (suspicious_results && wu.min_quorum < abs(g_app->target_nresults)) {
log_messages.printf(MSG_NORMAL, "suspicious result - raising quorum\n");
wu.min_quorum = abs(g_app->target_nresults);
}
if (good_results < wu.min_quorum) goto cleanup;
// Compare results

View File

@ -90,6 +90,7 @@ typedef enum {
char app_name[256];
DB_APP app;
DB_APP* g_app = &app;
int wu_id_modulus=0;
int wu_id_remainder=0;
int wu_id_min=0;

View File

@ -24,3 +24,6 @@ extern WORKUNIT* g_wup;
// A pointer to the WU currently being processed;
// you can access this in your init_result() etc. functions
// (which are passed RESULT but not WORKUNIT)
extern DB_APP* g_app;
// a pointer to the app (similar to above)