From 8627c9330d084a0fed50ecd15eaac702b3c6b44e Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Tue, 12 May 2015 14:15:01 -0700
Subject: [PATCH] Update comment to describe function better, and fix wrong use
 of the function.

---
 src/common/slurm_accounting_storage.c | 4 ++--
 src/slurmctld/job_mgr.c               | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/common/slurm_accounting_storage.c b/src/common/slurm_accounting_storage.c
index f5a73a66c18..c82dd7fc61d 100644
--- a/src/common/slurm_accounting_storage.c
+++ b/src/common/slurm_accounting_storage.c
@@ -283,8 +283,8 @@ static bool init_run = false;
 static uint16_t enforce = 0;
 
 /*
- * load into the storage information about a job,
- * typically when it begins execution, but possibly earlier
+ * If running with slurmdbd don't run if we don't have an index, else
+ * go ahead.
  */
 extern int jobacct_storage_job_start_direct(void *db_conn,
 					    struct job_record *job_ptr)
diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c
index 3857f37153a..25065fb0efd 100644
--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -7522,7 +7522,8 @@ static int _list_find_job_old(void *job_entry, void *key)
 	 * when slurmdbd comes back up since we won't get another chance.
 	 * job_start won't pend for job_db_inx when the job is finished.
 	 */
-	jobacct_storage_job_start_direct(acct_db_conn, job_ptr);
+	if (with_slurmdbd && !job_ptr->db_index)
+		jobacct_storage_g_job_start(acct_db_conn, job_ptr);
 
 	return 1;		/* Purge the job */
 }
-- 
GitLab