diff --git a/0015-fix-partition-conflict-in-tables.patch b/0015-fix-partition-conflict-in-tables.patch new file mode 100644 index 0000000000000000000000000000000000000000..f3f33ae87605b97469820401f96ff11ef594ca64 --- /dev/null +++ b/0015-fix-partition-conflict-in-tables.patch @@ -0,0 +1,117 @@ +From 789f77e49df3edca116d402bcba44f11f2400c60 Mon Sep 17 00:00:00 2001 +From: motodiary +Date: Thu, 16 May 2024 09:40:17 +0800 +Subject: [PATCH] fix 'partition' conflict in tables + +--- + src/plugins/accounting_storage/pgsql/as_pgsql_archive.c | 2 +- + src/plugins/accounting_storage/pgsql/as_pgsql_job.c | 6 +++--- + src/plugins/accounting_storage/pgsql/as_pgsql_problems.c | 4 ++-- + src/plugins/jobcomp/pgsql/jobcomp_pgsql.c | 4 ++-- + src/plugins/jobcomp/pgsql/pgsql_jobcomp_process.c | 2 +- + 5 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/plugins/accounting_storage/pgsql/as_pgsql_archive.c b/src/plugins/accounting_storage/pgsql/as_pgsql_archive.c +index 0899a8f..668a6aa 100755 +--- a/src/plugins/accounting_storage/pgsql/as_pgsql_archive.c ++++ b/src/plugins/accounting_storage/pgsql/as_pgsql_archive.c +@@ -506,7 +506,7 @@ static char *job_req_inx[] = { + "job_name", + "nodelist", + "node_inx", +- "`partition`", ++ "\"partition\"", + "priority", + "id_qos", + "cpus_req", +diff --git a/src/plugins/accounting_storage/pgsql/as_pgsql_job.c b/src/plugins/accounting_storage/pgsql/as_pgsql_job.c +index fcc7c93..7d1e1fa 100755 +--- a/src/plugins/accounting_storage/pgsql/as_pgsql_job.c ++++ b/src/plugins/accounting_storage/pgsql/as_pgsql_job.c +@@ -487,7 +487,7 @@ no_rollup_change: + if (job_ptr->account) + xstrcat(query, ", account"); + if (partition) +- xstrcat(query, ", `partition`"); ++ xstrcat(query, ", \"partition\""); + if (job_ptr->wckey) + xstrcat(query, ", wckey"); + if (job_ptr->network) +@@ -614,7 +614,7 @@ no_rollup_change: + if (job_ptr->account) + xstrfmtcat(query, ", account='%s'", job_ptr->account); + if (partition) +- xstrfmtcat(query, ", `partition`='%s'", partition); ++ xstrfmtcat(query, ", \"partition\"='%s'", partition); + if (job_ptr->wckey) + xstrfmtcat(query, ", wckey='%s'", job_ptr->wckey); + if (job_ptr->network) +@@ -686,7 +686,7 @@ no_rollup_change: + if (job_ptr->account) + xstrfmtcat(query, "account='%s', ", job_ptr->account); + if (partition) +- xstrfmtcat(query, "`partition`='%s', ", partition); ++ xstrfmtcat(query, "\"partition\"='%s', ", partition); + if (job_ptr->wckey) + xstrfmtcat(query, "wckey='%s', ", job_ptr->wckey); + if (job_ptr->network) +diff --git a/src/plugins/accounting_storage/pgsql/as_pgsql_problems.c b/src/plugins/accounting_storage/pgsql/as_pgsql_problems.c +index 3758646..35fa070 100755 +--- a/src/plugins/accounting_storage/pgsql/as_pgsql_problems.c ++++ b/src/plugins/accounting_storage/pgsql/as_pgsql_problems.c +@@ -93,7 +93,7 @@ static int _setup_assoc_cond_limits( + while ((object = list_next(itr))) { + if (set) + xstrcat(*extra, " OR "); +- xstrfmtcat(*extra, "`partition`='%s'", object); ++ xstrfmtcat(*extra, "\"partition\"='%s'", object); + set = 1; + } + list_iterator_destroy(itr); +@@ -230,7 +230,7 @@ extern int as_pgsql_acct_no_users(pgsql_conn_t *pgsql_conn, + "id_assoc", + "user", + "acct", +- "`partition`", ++ "\"partition\"", + "parent_acct", + }; + enum { +diff --git a/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c b/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c +index 8a3edaf..55db072 100755 +--- a/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c ++++ b/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c +@@ -307,7 +307,7 @@ extern int jobcomp_p_log_record(job_record_t *job_ptr) + SELECT_PRINT_RESV_ID); + query = xstrdup_printf( + "insert into %s (jobid, uid, user_name, gid, group_name, " +- "name, state, proc_cnt, `partition`, timelimit, " ++ "name, state, proc_cnt, \"partition\", timelimit, " + "starttime, endtime, nodecnt", + jobcomp_table); + +@@ -335,7 +335,7 @@ extern int jobcomp_p_log_record(job_record_t *job_ptr) + start_time, end_time, job_ptr->node_cnt); + + xstrfmtcat(on_dup, "uid=%u, user_name='%s', gid=%u, group_name='%s', " +- "name='%s', state=%u, proc_cnt=%u, `partition`='%s', " ++ "name='%s', state=%u, proc_cnt=%u, \"partition\"='%s', " + "timelimit='%s', nodecnt=%u", + job_ptr->user_id, usr_str, job_ptr->group_id, grp_str, jname, + job_state, job_ptr->total_cpus, job_ptr->partition, lim_str, +diff --git a/src/plugins/jobcomp/pgsql/pgsql_jobcomp_process.c b/src/plugins/jobcomp/pgsql/pgsql_jobcomp_process.c +index 91770d4..eeec354 100755 +--- a/src/plugins/jobcomp/pgsql/pgsql_jobcomp_process.c ++++ b/src/plugins/jobcomp/pgsql/pgsql_jobcomp_process.c +@@ -93,7 +93,7 @@ extern List pgsql_jobcomp_process_get_jobs(slurmdb_job_cond_t *job_cond) + while ((selected_part = list_next(itr))) { + if (set) + xstrcat(extra, " OR "); +- tmp = xstrdup_printf("`partition`='%s'", ++ tmp = xstrdup_printf("\"partition\"='%s'", + selected_part); + xstrcat(extra, tmp); + set = 1; +-- +2.33.0 + diff --git a/slurm.spec b/slurm.spec index ab2054a2e58719d32337b294159ce65d08996d22..312e4469edf1f5c63089bc4168d2168d7b071ae8 100644 --- a/slurm.spec +++ b/slurm.spec @@ -1,6 +1,6 @@ Name: slurm Version: 21.08.8 -%define rel 17 +%define rel 18 Release: %{rel}%{?dist} Summary: Slurm Workload Manager @@ -30,6 +30,7 @@ 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 +Patch15: 0015-fix-partition-conflict-in-tables.patch # build options .rpmmacros options change to default action # ==================== ==================== ======================== @@ -722,6 +723,9 @@ rm -rf %{buildroot} %systemd_postun_with_restart slurmdbd.service %changelog +* Thu May 16 2024 Xing Liu - 21.08.8-18 +- fix 'partition' conflict in tables + * Wed May 15 2024 Xing Liu - 21.08.8-17 - remove 'FOR UPDATE' in sql