From dbf72f4c1f2e43e8e167b2007e8bcccb1c90c52a Mon Sep 17 00:00:00 2001
From: Brian Christiansen <brian@schedmd.com>
Date: Tue, 2 May 2017 13:33:41 -0600
Subject: [PATCH] Don't show REVOKED sibling jobs unless using -D

---
 doc/man/man1/sacct.1                                        | 4 ++++
 .../accounting_storage/mysql/as_mysql_jobacct_process.c     | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/doc/man/man1/sacct.1 b/doc/man/man1/sacct.1
index 41605ca6e60..e4dcebfe89b 100644
--- a/doc/man/man1/sacct.1
+++ b/doc/man/man1/sacct.1
@@ -116,6 +116,10 @@ When data for specific jobs are requested with the \-\-jobs option,
 behavior can be overridden by specifying \-\-duplicates, in which case
 all records that match the selection criteria will be returned.
 
+.IP
+NOTE: Revoked federated sibling jobs are hidden unless the \-\-duplicates option
+is specified.
+
 .TP
 \f3\-e\fP\f3,\fP \f3\-\-helpformat\fP
 .IP
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c b/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c
index d27dd2cf64e..88f2dd368eb 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c
@@ -1248,6 +1248,12 @@ no_resv:
 		xstrcat(*extra, ")");
 	}
 
+	/* Don't show revoked sibling federated jobs w/out -D */
+	if (!job_cond->duplicates)
+		xstrfmtcat(*extra, " %s (state != %d)",
+			   *extra ? "&&" : "where",
+			   JOB_REVOKED);
+
 	return SLURM_SUCCESS;
 }
 
-- 
GitLab