From a06df2216811c34a00c97f7efb529d41dcb56712 Mon Sep 17 00:00:00 2001 From: motodiary Date: Wed, 15 May 2024 15:08:02 +0800 Subject: [PATCH] remove 'FOR UPDATE' in sql Signed-off-by: motodiary --- 0014-remove-FOR-UPDATE-in-sql.patch | 44 +++++++++++++++++++++++++++++ slurm.spec | 6 +++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 0014-remove-FOR-UPDATE-in-sql.patch diff --git a/0014-remove-FOR-UPDATE-in-sql.patch b/0014-remove-FOR-UPDATE-in-sql.patch new file mode 100644 index 0000000..1d0b070 --- /dev/null +++ b/0014-remove-FOR-UPDATE-in-sql.patch @@ -0,0 +1,44 @@ +From ebb0a2fa74951cf59b47b1a67830dc909d79a052 Mon Sep 17 00:00:00 2001 +From: motodiary +Date: Wed, 15 May 2024 15:01:09 +0800 +Subject: [PATCH] remove 'FOR UPDATE' in sql + +--- + src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c b/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c +index 676e22f..eb0eb9c 100755 +--- a/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c ++++ b/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c +@@ -2677,8 +2677,7 @@ extern int as_pgsql_add_assocs(pgsql_conn_t *pgsql_conn, uint32_t uid, + xstrfmtcat(tmp_char, ", %s", aassoc_req_inx[i]); + + xstrfmtcat(query, +- "select distinct %s from \"%s_%s\" %s order by lft " +- "FOR UPDATE;", ++ "select distinct %s from \"%s_%s\" %s order by lft;", + tmp_char, object->cluster, assoc_table, update); + xfree(tmp_char); + DB_DEBUG(DB_ASSOC, pgsql_conn->conn, "query\n%s", query); +@@ -3242,7 +3241,7 @@ is_same_user: + + xstrfmtcat(query, "select distinct %s " + "from \"%s_%s\" as t1%s%s " +- "order by lft FOR UPDATE;", ++ "order by lft;", + object, cluster_name, + assoc_table, qos_extra, extra); + xfree(qos_extra); +@@ -3371,7 +3370,7 @@ extern List as_pgsql_remove_assocs(pgsql_conn_t *pgsql_conn, uint32_t uid, + + query = xstrdup_printf("select distinct t1.lft, t1.rgt from " + "\"%s_%s\" as t1%s%s order by " +- "lft FOR UPDATE;", ++ "lft;", + cluster_name, assoc_table, + qos_extra, extra); + xfree(qos_extra); +-- +2.33.0 + diff --git a/slurm.spec b/slurm.spec index 3fdf78c..ab2054a 100644 --- a/slurm.spec +++ b/slurm.spec @@ -1,6 +1,6 @@ Name: slurm Version: 21.08.8 -%define rel 16 +%define rel 17 Release: %{rel}%{?dist} Summary: Slurm Workload Manager @@ -29,6 +29,7 @@ Patch10: 0010-use-pgsql_handle_quotes-to-replace-old-method.patch Patch11: 0011-Adjusting-the-implementation-of-last_affect_row.patch Patch12: 0012-fix-some-sql-statements.patch Patch13: 0013-fixed-the-partition-field-in-sql.patch +Patch14: 0014-remove-FOR-UPDATE-in-sql.patch # build options .rpmmacros options change to default action # ==================== ==================== ======================== @@ -721,6 +722,9 @@ rm -rf %{buildroot} %systemd_postun_with_restart slurmdbd.service %changelog +* Wed May 15 2024 Xing Liu - 21.08.8-17 +- remove 'FOR UPDATE' in sql + * Wed May 15 2024 Xing Liu - 21.08.8-16 - fixed the 'partition' field in sql -- Gitee