From cef01a2fab4ddfb83bc06ca6b1dc866b96ea2167 Mon Sep 17 00:00:00 2001 From: motodiary Date: Mon, 3 Jun 2024 10:31:59 +0800 Subject: [PATCH] fix association,GrpTRES,get_parent_limits errors --- ...ion-GrpTRES-get_parent_limits-errors.patch | 72 +++++++++++++++++++ slurm.spec | 6 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 0039-fix-association-GrpTRES-get_parent_limits-errors.patch diff --git a/0039-fix-association-GrpTRES-get_parent_limits-errors.patch b/0039-fix-association-GrpTRES-get_parent_limits-errors.patch new file mode 100644 index 0000000..95b67ad --- /dev/null +++ b/0039-fix-association-GrpTRES-get_parent_limits-errors.patch @@ -0,0 +1,72 @@ +From 7093fe816568b31eba40e9dedce06edda2426f69 Mon Sep 17 00:00:00 2001 +From: motodiary +Date: Mon, 3 Jun 2024 10:27:42 +0800 +Subject: [PATCH] fix association,GrpTRES,get_parent_limits errors + +--- + .../pgsql/accounting_storage_pgsql.c | 11 +++++------ + .../accounting_storage/pgsql/as_pgsql_cluster.c | 5 ++--- + 2 files changed, 7 insertions(+), 9 deletions(-) + +diff --git a/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c b/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c +index 67442aa..c3b5af6 100755 +--- a/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c ++++ b/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c +@@ -547,7 +547,7 @@ static int _as_pgsql_acct_check_tables(pgsql_conn_t *pgsql_conn) + { "id", "serial", "not null" }, + { "name", "text", "not null" }, + { "description", "text", "default null" }, +- { "manager", "text", "not null" }, ++ { "manager", "text", "not null|default ''" }, + { "server", "text", "not null" }, + { "count", "integer", "default 0" }, + { "type", "integer", "default 0" }, +@@ -682,7 +682,7 @@ static int _as_pgsql_acct_check_tables(pgsql_conn_t *pgsql_conn) + s := s || 'qos, delta_qos, '; \n\ + ELSE \n\ + IF delta_qos = '' THEN \n\ +- s := s || qos || ', ' || E'\'' || E'\'' || ', '; \n\ ++ s := s || qos || ', ' || '\'\'' || '\'\'' || ', '; \n\ + ELSE \n\ + s := s || qos || ', ' || delta_qos || ', '; \n\ + END IF; \n\ +@@ -1137,8 +1137,8 @@ extern int create_cluster_assoc_table( + { "grp_wall", "integer", "default NULL" }, + { "priority", "integer", "default NULL" }, + { "def_qos_id", "integer", "default NULL" }, +- { "qos", "bytea", "not null|default ''" }, +- { "delta_qos", "bytea", "not null|default ''" }, ++ { "qos", "text", "not null|default ''" }, ++ { "delta_qos", "text", "not null|default ''" }, + { NULL, NULL} + }; + +@@ -2459,8 +2459,7 @@ extern void mod_tres_str(char **out, char *mod, char *cur, + * this since this seems like a hack, but it + * does do the job. + */ +- xstrfmtcat(*vals, ", %s = " +- "if (%s=%u, '%s', %s)", ++ xstrfmtcat(*vals, ", %s = CASE WHEN %s=%u THEN '%s' ELSE %s END ", + name, assoc ? "id_assoc" : "id", id, + *out, name); + /* xstrfmtcat(*vals, ", %s='%s%s')", */ +diff --git a/src/plugins/accounting_storage/pgsql/as_pgsql_cluster.c b/src/plugins/accounting_storage/pgsql/as_pgsql_cluster.c +index adc7601..1af53fe 100755 +--- a/src/plugins/accounting_storage/pgsql/as_pgsql_cluster.c ++++ b/src/plugins/accounting_storage/pgsql/as_pgsql_cluster.c +@@ -366,9 +366,8 @@ extern int as_pgsql_add_clusters(pgsql_conn_t *pgsql_conn, uint32_t uid, + xstrfmtcat(query, + "INSERT INTO \"%s_%s\" (%s, lft, rgt) " + "VALUES (%s, 1, 2) " +- "ON CONFLICT (\"user\", acct, \"partition\") DO UPDATE SET deleted=0, " +- "id_assoc=currval(pg_get_serial_sequence('%s_%s', 'id_assoc'))%s;", +- object->name, assoc_table, cols, vals, object->name, assoc_table, extra); ++ "ON CONFLICT (\"user\", acct, \"partition\") DO UPDATE SET deleted=0%s;", ++ object->name, assoc_table, cols, vals, extra); + xfree(cols); + xfree(vals); + DB_DEBUG(DB_ASSOC, pgsql_conn->conn, "query\n%s", query); +-- +2.33.0 + diff --git a/slurm.spec b/slurm.spec index ce207bf..6b60d8f 100644 --- a/slurm.spec +++ b/slurm.spec @@ -1,6 +1,6 @@ Name: slurm Version: 21.08.8 -%define rel 41 +%define rel 42 Release: %{rel}%{?dist} Summary: Slurm Workload Manager @@ -54,6 +54,7 @@ Patch35: 0035-fix-the-sql-error-in-adding-resource.patch Patch36: 0036-fix-the-DefaultWCKey-not-working.patch Patch37: 0037-fix-adding-tres-resource-failure.patch Patch38: 0038-fix-querying-the-user-binding-qos.patch +Patch39: 0039-fix-association-GrpTRES-get_parent_limits-errors.patch # build options .rpmmacros options change to default action # ==================== ==================== ======================== @@ -746,6 +747,9 @@ rm -rf %{buildroot} %systemd_postun_with_restart slurmdbd.service %changelog +* Mon Jun 03 2024 Xing Liu - 21.08.8-42 +- fix association,GrpTRES,get_parent_limits errors + * Fri May 31 2024 Xing Liu - 21.08.8-41 - fix querying the user binding qos -- Gitee