diff --git a/src/slurmctld/node_mgr.c b/src/slurmctld/node_mgr.c index 8481486fd9836749214340e26aa2b63381079e45..3e3ab615eb1ad0a22f7530dd26d480fca4fd7d63 100644 --- a/src/slurmctld/node_mgr.c +++ b/src/slurmctld/node_mgr.c @@ -1333,6 +1333,10 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) } } else { uint16_t err_cpus = 0; + select_g_select_nodeinfo_get(node_ptr->select_nodeinfo, + SELECT_NODEDATA_SUBCNT, + NODE_STATE_ERROR, + &err_cpus); if (IS_NODE_UNKNOWN(node_ptr)) { last_node_update = time (NULL); reset_job_priority(); @@ -1346,6 +1350,14 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) node_flags; node_ptr->last_idle = now; } + if (!err_cpus + && !IS_NODE_DRAIN(node_ptr) + && !IS_NODE_FAIL(node_ptr)) { + xfree(node_ptr->reason); + clusteracct_storage_g_node_up( + acct_db_conn, slurmctld_cluster_name, + node_ptr, now); + } } else if (IS_NODE_DOWN(node_ptr) && ((slurmctld_conf.ret2service == 2) || ((slurmctld_conf.ret2service == 1) && @@ -1365,6 +1377,14 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) reg_msg->node_name); reset_job_priority(); trigger_node_up(node_ptr); + if (!err_cpus + && !IS_NODE_DRAIN(node_ptr) + && !IS_NODE_FAIL(node_ptr)) { + xfree(node_ptr->reason); + clusteracct_storage_g_node_up( + acct_db_conn, slurmctld_cluster_name, + node_ptr, now); + } } else if (IS_NODE_ALLOCATED(node_ptr) && (reg_msg->job_count == 0)) { /* job vanished */ last_node_update = now; @@ -1376,19 +1396,6 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) node_ptr->node_state &= (~NODE_STATE_COMPLETING); } - select_g_select_nodeinfo_get(node_ptr->select_nodeinfo, - SELECT_NODEDATA_SUBCNT, - NODE_STATE_ERROR, - &err_cpus); - if (!err_cpus && !IS_NODE_DOWN(node_ptr) - && !IS_NODE_DRAIN(node_ptr) - && !IS_NODE_FAIL(node_ptr)) { - xfree(node_ptr->reason); - clusteracct_storage_g_node_up( - acct_db_conn, slurmctld_cluster_name, - node_ptr, now); - } - select_g_update_node_config((node_ptr-node_record_table_ptr)); select_g_update_node_state((node_ptr - node_record_table_ptr), node_ptr->node_state); @@ -1540,6 +1547,10 @@ extern int validate_nodes_via_front_end( } } else { uint16_t err_cpus = 0; + select_g_select_nodeinfo_get(node_ptr->select_nodeinfo, + SELECT_NODEDATA_SUBCNT, + NODE_STATE_ERROR, + &err_cpus); if (reg_hostlist) (void) hostlist_push_host( reg_hostlist, node_ptr->name); @@ -1559,6 +1570,15 @@ extern int validate_nodes_via_front_end( node_flags; node_ptr->last_idle = now; } + if (!err_cpus + && !IS_NODE_DRAIN(node_ptr) + && !IS_NODE_FAIL(node_ptr)) { + xfree(node_ptr->reason); + clusteracct_storage_g_node_up( + acct_db_conn, + slurmctld_cluster_name, + node_ptr, now); + } } else if (IS_NODE_DOWN(node_ptr) && (slurmctld_conf.ret2service == 1)) { updated_job = true; @@ -1573,6 +1593,15 @@ extern int validate_nodes_via_front_end( node_ptr->last_idle = now; } trigger_node_up(node_ptr); + if (!err_cpus + && !IS_NODE_DRAIN(node_ptr) + && !IS_NODE_FAIL(node_ptr)) { + xfree(node_ptr->reason); + clusteracct_storage_g_node_up( + acct_db_conn, + slurmctld_cluster_name, + node_ptr, now); + } } else if (IS_NODE_ALLOCATED(node_ptr) && (jobs_on_node == 0)) { /* job vanished */ @@ -1588,19 +1617,6 @@ extern int validate_nodes_via_front_end( (~NODE_STATE_COMPLETING); } - select_g_select_nodeinfo_get(node_ptr->select_nodeinfo, - SELECT_NODEDATA_SUBCNT, - NODE_STATE_ERROR, - &err_cpus); - if (!err_cpus && !IS_NODE_DOWN(node_ptr) - && !IS_NODE_DRAIN(node_ptr) - && !IS_NODE_FAIL(node_ptr)) { - xfree(node_ptr->reason); - clusteracct_storage_g_node_up( - acct_db_conn, slurmctld_cluster_name, - node_ptr, now); - } - select_g_update_node_config( (node_ptr - node_record_table_ptr)); select_g_update_node_state( diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c index 3868cf85e30f906af28d2cfa5a53611320d1f9e8..c685359a23598b77e580a674640ec5a530952bd8 100644 --- a/src/slurmctld/read_config.c +++ b/src/slurmctld/read_config.c @@ -1077,8 +1077,7 @@ static int _sync_nodes_to_active_job(struct job_record *job_ptr) xfree(job_ptr->state_desc); job_completion_logger(job_ptr); cnt++; - } else if (IS_NODE_UNKNOWN(node_ptr) || - IS_NODE_IDLE(node_ptr)) { + } else if (IS_NODE_IDLE(node_ptr)) { cnt++; node_ptr->node_state = NODE_STATE_ALLOCATED | node_flags;