From 691479ff634e0651a5b0ca41a23b50c40b29d07b Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Tue, 23 Dec 2003 23:56:40 +0000
Subject: [PATCH] Fix bug which could prevent DOWN node from transitioning to
 DRAINED state   (it was inappropriately going to DRAINING state).

---
 src/slurmctld/node_mgr.c    | 4 +---
 src/slurmctld/read_config.c | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/slurmctld/node_mgr.c b/src/slurmctld/node_mgr.c
index 053a782d8e6..7922451a786 100644
--- a/src/slurmctld/node_mgr.c
+++ b/src/slurmctld/node_mgr.c
@@ -989,8 +989,6 @@ int update_node ( update_node_msg_t * update_node_msg )
 				_make_node_down(node_ptr);
 				kill_running_job_by_node_name (this_node_name,
 							       false);
-				bit_set   (idle_node_bitmap, node_inx);
-				bit_clear (avail_node_bitmap, node_inx);
 			}
 			else if (state_val == NODE_STATE_IDLE) {
 				bit_set (avail_node_bitmap, node_inx);
@@ -1570,7 +1568,7 @@ static void _make_node_down(struct node_record *node_ptr)
 	no_resp_flag = node_ptr->node_state & NODE_STATE_NO_RESPOND;
 	node_ptr->node_state = NODE_STATE_DOWN | no_resp_flag;
 	bit_clear (avail_node_bitmap, inx);
-	bit_clear (idle_node_bitmap,  inx);
+	bit_set   (idle_node_bitmap,  inx);
 	bit_set   (share_node_bitmap, inx);
 }
 
diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c
index 3358c88a094..0c6f8b3393b 100644
--- a/src/slurmctld/read_config.c
+++ b/src/slurmctld/read_config.c
@@ -112,7 +112,7 @@ static int _build_bitmaps(void)
 	share_node_bitmap = (bitstr_t *) bit_alloc(node_record_count);
 	if ((idle_node_bitmap     == NULL) ||
 	    (avail_node_bitmap    == NULL) ||
-	    (share_node_bitmap == NULL)) 
+	    (share_node_bitmap    == NULL)) 
 		fatal ("memory allocation failure");
 	/* Set all bits, all nodes initially available for sharing */
 	bit_nset(share_node_bitmap, 0, (node_record_count-1));
-- 
GitLab