Skip to content
Snippets Groups Projects
Commit eb16d783 authored by Danny Auble's avatar Danny Auble
Browse files

Alter _determine_and_validate_qos to change debug level on the fly.

Currently no functional change.

Bug 8134
parent c928a064
No related branches found
No related tags found
No related merge requests found
...@@ -189,7 +189,7 @@ static void _delete_job_details(job_record_t *job_entry); ...@@ -189,7 +189,7 @@ static void _delete_job_details(job_record_t *job_entry);
static slurmdb_qos_rec_t *_determine_and_validate_qos( static slurmdb_qos_rec_t *_determine_and_validate_qos(
char *resv_name, slurmdb_assoc_rec_t *assoc_ptr, char *resv_name, slurmdb_assoc_rec_t *assoc_ptr,
bool operator, slurmdb_qos_rec_t *qos_rec, int *error_code, bool operator, slurmdb_qos_rec_t *qos_rec, int *error_code,
bool locked); bool locked, log_level_t log_lvl);
static void _dump_job_details(struct job_details *detail_ptr, Buf buffer); static void _dump_job_details(struct job_details *detail_ptr, Buf buffer);
static void _dump_job_state(job_record_t *dump_job_ptr, Buf buffer); static void _dump_job_state(job_record_t *dump_job_ptr, Buf buffer);
static void _dump_job_fed_details(job_fed_details_t *fed_details_ptr, static void _dump_job_fed_details(job_fed_details_t *fed_details_ptr,
...@@ -755,7 +755,7 @@ static uint32_t _max_switch_wait(uint32_t input_wait) ...@@ -755,7 +755,7 @@ static uint32_t _max_switch_wait(uint32_t input_wait)
static slurmdb_qos_rec_t *_determine_and_validate_qos( static slurmdb_qos_rec_t *_determine_and_validate_qos(
char *resv_name, slurmdb_assoc_rec_t *assoc_ptr, char *resv_name, slurmdb_assoc_rec_t *assoc_ptr,
bool operator, slurmdb_qos_rec_t *qos_rec, int *error_code, bool operator, slurmdb_qos_rec_t *qos_rec, int *error_code,
bool locked) bool locked, log_level_t log_lvl)
{ {
slurmdb_qos_rec_t *qos_ptr = NULL; slurmdb_qos_rec_t *qos_ptr = NULL;
   
...@@ -768,7 +768,7 @@ static slurmdb_qos_rec_t *_determine_and_validate_qos( ...@@ -768,7 +768,7 @@ static slurmdb_qos_rec_t *_determine_and_validate_qos(
assoc_mgr_get_default_qos_info(assoc_ptr, qos_rec); assoc_mgr_get_default_qos_info(assoc_ptr, qos_rec);
if (assoc_mgr_fill_in_qos(acct_db_conn, qos_rec, accounting_enforce, if (assoc_mgr_fill_in_qos(acct_db_conn, qos_rec, accounting_enforce,
&qos_ptr, locked) != SLURM_SUCCESS) { &qos_ptr, locked) != SLURM_SUCCESS) {
error("Invalid qos (%s)", qos_rec->name); log_var(log_lvl, "Invalid qos (%s)", qos_rec->name);
*error_code = ESLURM_INVALID_QOS; *error_code = ESLURM_INVALID_QOS;
return NULL; return NULL;
} }
...@@ -778,19 +778,17 @@ static slurmdb_qos_rec_t *_determine_and_validate_qos( ...@@ -778,19 +778,17 @@ static slurmdb_qos_rec_t *_determine_and_validate_qos(
&& !operator && !operator
&& (!assoc_ptr->usage->valid_qos && (!assoc_ptr->usage->valid_qos
|| !bit_test(assoc_ptr->usage->valid_qos, qos_rec->id))) { || !bit_test(assoc_ptr->usage->valid_qos, qos_rec->id))) {
error("This association %d(account='%s', " log_var(log_lvl, "This association %d(account='%s', user='%s', partition='%s') does not have access to qos %s",
"user='%s', partition='%s') does not have " assoc_ptr->id, assoc_ptr->acct, assoc_ptr->user,
"access to qos %s", assoc_ptr->partition, qos_rec->name);
assoc_ptr->id, assoc_ptr->acct, assoc_ptr->user,
assoc_ptr->partition, qos_rec->name);
*error_code = ESLURM_INVALID_QOS; *error_code = ESLURM_INVALID_QOS;
return NULL; return NULL;
} }
   
if (qos_ptr && (qos_ptr->flags & QOS_FLAG_REQ_RESV) if (qos_ptr && (qos_ptr->flags & QOS_FLAG_REQ_RESV)
&& (!resv_name || resv_name[0] == '\0')) { && (!resv_name || resv_name[0] == '\0')) {
error("qos %s can only be used in a reservation", log_var(log_lvl, "qos %s can only be used in a reservation",
qos_rec->name); qos_rec->name);
*error_code = ESLURM_INVALID_QOS; *error_code = ESLURM_INVALID_QOS;
return NULL; return NULL;
} }
...@@ -2493,7 +2491,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version) ...@@ -2493,7 +2491,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
job_ptr->qos_ptr = _determine_and_validate_qos( job_ptr->qos_ptr = _determine_and_validate_qos(
job_ptr->resv_name, job_ptr->assoc_ptr, job_ptr->resv_name, job_ptr->assoc_ptr,
job_ptr->limit_set.qos, &qos_rec, job_ptr->limit_set.qos, &qos_rec,
&qos_error, true); &qos_error, true, LOG_LEVEL_ERROR);
if ((qos_error != SLURM_SUCCESS) && !job_ptr->limit_set.qos) { if ((qos_error != SLURM_SUCCESS) && !job_ptr->limit_set.qos) {
job_fail_qos(job_ptr, __func__); job_fail_qos(job_ptr, __func__);
} else } else
...@@ -6986,7 +6984,7 @@ static int _job_create(job_desc_msg_t *job_desc, int allocate, int will_run, ...@@ -6986,7 +6984,7 @@ static int _job_create(job_desc_msg_t *job_desc, int allocate, int will_run,
   
qos_ptr = _determine_and_validate_qos( qos_ptr = _determine_and_validate_qos(
job_desc->reservation, assoc_ptr, false, &qos_rec, &qos_error, job_desc->reservation, assoc_ptr, false, &qos_rec, &qos_error,
false); false, LOG_LEVEL_ERROR);
   
if (qos_error != SLURM_SUCCESS) { if (qos_error != SLURM_SUCCESS) {
error_code = qos_error; error_code = qos_error;
...@@ -11903,7 +11901,8 @@ static int _update_job(job_record_t *job_ptr, job_desc_msg_t *job_specs, ...@@ -11903,7 +11901,8 @@ static int _update_job(job_record_t *job_ptr, job_desc_msg_t *job_specs,
   
new_qos_ptr = _determine_and_validate_qos( new_qos_ptr = _determine_and_validate_qos(
resv_name, use_assoc_ptr, resv_name, use_assoc_ptr,
operator, &qos_rec, &error_code, false); operator, &qos_rec, &error_code, false,
LOG_LEVEL_ERROR);
if ((error_code == SLURM_SUCCESS) && new_qos_ptr) { if ((error_code == SLURM_SUCCESS) && new_qos_ptr) {
if (job_ptr->qos_ptr == new_qos_ptr) { if (job_ptr->qos_ptr == new_qos_ptr) {
sched_debug("%s: new QOS identical to old QOS %pJ", sched_debug("%s: new QOS identical to old QOS %pJ",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment