From 8a110516c292817a889b31eab39e37f0370e8e8b Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Thu, 27 Mar 2003 18:52:44 +0000
Subject: [PATCH] Let the slurmctld FirstJobId increase on a reconfig.

---
 src/slurmctld/job_mgr.c     | 7 +++++++
 src/slurmctld/read_config.c | 1 +
 src/slurmctld/slurmctld.h   | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c
index 2a997220739..a6acdcb7746 100644
--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -2345,6 +2345,13 @@ static void _reset_step_bitmaps(struct job_record *job_ptr)
 	return;
 }
 
+/* update first assigned job id as needed on reconfigure */
+void reset_first_job_id(void)
+{
+	if (job_id_sequence < slurmctld_conf.first_job_id)
+		job_id_sequence = slurmctld_conf.first_job_id;
+}
+
 /*
  * _set_job_id - set a default job_id, insure that it is unique
  * IN job_ptr - pointer to the job_record
diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c
index 21ac6b5a0e3..9e345af0869 100644
--- a/src/slurmctld/read_config.c
+++ b/src/slurmctld/read_config.c
@@ -746,6 +746,7 @@ int read_slurm_conf(int recover)
 		(void) load_all_part_state();
 		(void) load_all_job_state();
 	} else {
+		reset_first_job_id();
 		if (old_node_table_ptr) {
 			info("restoring original state of nodes");
 			for (i = 0; i < old_node_record_count; i++) {
diff --git a/src/slurmctld/slurmctld.h b/src/slurmctld/slurmctld.h
index 6c49e567f64..717d6539b1b 100644
--- a/src/slurmctld/slurmctld.h
+++ b/src/slurmctld/slurmctld.h
@@ -834,6 +834,9 @@ extern int  read_slurm_conf (int recover);
  */
 extern void rehash (void);
 
+/* update first assigned job id as needed on reconfigure */
+extern void reset_first_job_id(void);
+
 /* 
  * reset_job_bitmaps - reestablish bitmaps for existing jobs. 
  *	this should be called after rebuilding node information, 
-- 
GitLab