diff --git a/0042-Change-the-serial-type-to-integer.patch b/0042-Change-the-serial-type-to-integer.patch new file mode 100644 index 0000000000000000000000000000000000000000..67b4a9a32d14e3f8dba8cd93004a290c895e903e --- /dev/null +++ b/0042-Change-the-serial-type-to-integer.patch @@ -0,0 +1,109 @@ +From 60015d03795aadd7df2ed9b4c688bc526d493ab6 Mon Sep 17 00:00:00 2001 +From: motodiary +Date: Tue, 4 Jun 2024 14:32:45 +0800 +Subject: [PATCH] Change the serial type to integer + +--- + .../pgsql/accounting_storage_pgsql.c | 79 +++++++++---------- + 1 file changed, 37 insertions(+), 42 deletions(-) + +diff --git a/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c b/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c +index 3f22fde..b7be941 100755 +--- a/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c ++++ b/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c +@@ -447,7 +447,7 @@ static int _as_pgsql_acct_check_tables(pgsql_conn_t *pgsql_conn) + storage_field_t tres_table_fields[] = { + { "creation_time", "numeric", "not null" }, + { "deleted", "smallint", "default 0|not null" }, +- { "id", "serial", "not null" }, ++ { "id", "integer", "not null" }, + { "type", "varchar", "not null" }, + { "name", "varchar", "not null|default ''" }, + { NULL, NULL} +@@ -710,47 +710,42 @@ static int _as_pgsql_acct_check_tables(pgsql_conn_t *pgsql_conn) + $$LANGUAGE plpgsql;"; + + char* get_coord_qos = +- "CREATE OR REPLACE FUNCTION get_coord_qos(my_table text, acct text, cluster text, coord text) \n \ +- RETURNS TABLE(qos text, delta_qos text) AS \n \ +- $$\n \ +- DECLARE\n \ +- qos text;\n \ +- delta_qos text;\n \ +- found_coord_curr text;\n \ +- my_acct text;\n \ +- BEGIN\n \ +- qos := '';\n \ +- delta_qos := '';\n \ +- found_coord_curr := NULL;\n \ +- my_acct := acct;\n \ +- \n \ +- LOOP \n \ +- EXECUTE 'SELECT t1.qos, REPLACE(COALESCE(t1.delta_qos || '''' || delta_qos, ''''), '','''') ' \n \ +- 'INTO STRICT qos, delta_qos ' \n \ +- 'FROM ' || quote_ident(cluster || '_' || my_table) || ' t1 ' \n \ +- 'LEFT OUTER JOIN acct_coord_table t2 ON t1.acct = t2.acct '\n \ +- 'WHERE t1.acct = ' || quote_literal(my_acct) || \n \ +- ' AND t1.user = ''' || '''' || \n \ +- ' AND (t2.user = ' || quote_literal(coord) || ' OR t2.user IS NULL)'; \n \ +- \n \ +- IF found_coord_curr IS NOT NULL THEN \n \ +- EXIT;\n \ +- END IF; \n \ +- \n \ +- IF found_coord_curr IS NULL THEN \n \ +- qos := ''; \n \ +- delta_qos := '';\n \ +- END IF; \n \ +- \n \ +- my_acct := my_acct_new; \n \ +- \n \ +- EXIT WHEN qos != '' OR my_acct = ''; \n \ +- END LOOP; \n \ +- \n \ +- RETURN QUERY SELECT REPLACE(COALESCE(qos || '''' || delta_qos, ''''), ',,', ','); \n \ +- END;\n \ +- $$ \n \ +- LANGUAGE plpgsql;"; ++ "CREATE OR REPLACE FUNCTION get_coord_qos(my_table text, acct text, cluster text, coord text) \n\ ++ RETURNS text AS $$ \n\ ++ DECLARE \n\ ++ qos text; \n\ ++ delta_qos text; \n\ ++ found_coord text; \n\ ++ my_acct text := acct; \n\ ++ s text; \n\ ++ my_acct_new text; \n\ ++ found_coord_curr text; \n\ ++ BEGIN \n\ ++ qos := ''; \n\ ++ delta_qos := ''; \n\ ++ found_coord := NULL; \n\ ++ \n\ ++ LOOP \n\ ++ s := 'select qos, delta_qos, parent_acct, t2.user from \"' || cluster || '_' || my_table || '\" as t1 left outer join acct_coord_table as t2 on t1.acct = t2.acct where t1.acct = ''' || my_acct || ''' and t1.user = ''' || ''' and (t2.user = ''' || coord || ''' or t2.user is null)'; \n\ ++ EXECUTE s INTO qos, delta_qos, my_acct_new, found_coord_curr; \n\ ++ \n\ ++ IF found_coord_curr IS NOT NULL THEN \n\ ++ found_coord := found_coord_curr; \n\ ++ END IF; \n\ ++ \n\ ++ IF found_coord IS NULL THEN \n\ ++ qos := ''; \n\ ++ delta_qos := ''; \n\ ++ END IF; \n\ ++ \n\ ++ my_acct := my_acct_new; \n\ ++ \n\ ++ EXIT WHEN qos != '' OR my_acct = ''; \n\ ++ END LOOP; \n\ ++ \n\ ++ RETURN REPLACE(CONCAT(qos, delta_qos), ',,', ','); \n\ ++ END; \n\ ++ $$ LANGUAGE plpgsql;"; + + char *query = NULL; + time_t now = time(NULL); +-- +2.33.0 + diff --git a/slurm.spec b/slurm.spec index 562d4a7d19af2fa17be9fb4d7917040ad3111147..f48bc3b340e812e0ed114f8c2c0e35ff8bfc3041 100644 --- a/slurm.spec +++ b/slurm.spec @@ -1,6 +1,6 @@ Name: slurm Version: 21.08.8 -%define rel 44 +%define rel 45 Release: %{rel}%{?dist} Summary: Slurm Workload Manager @@ -57,6 +57,7 @@ Patch38: 0038-fix-querying-the-user-binding-qos.patch Patch39: 0039-fix-association-GrpTRES-get_parent_limits-errors.patch Patch40: 0040-Remove-redundant-SQL-statements-in-adding-tres.patch Patch41: 0041-Fix-compilation-warnings.patch +Patch42: 0042-Change-the-serial-type-to-integer.patch # build options .rpmmacros options change to default action # ==================== ==================== ======================== @@ -749,6 +750,9 @@ rm -rf %{buildroot} %systemd_postun_with_restart slurmdbd.service %changelog +* Tue Jun 04 2024 Xing Liu - 21.08.8-45 +- Change the serial type to integer + * Tue Jun 04 2024 Xing Liu - 21.08.8-44 - Fix compilation warnings