From c39cb6291511855b8e4c9919daf241c27ab69617 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 4 Jul 2025 19:28:46 +0200 Subject: [PATCH] staging-sync/koji: Bump DB sequence numbers Starting IDs for task/build etc. must be greater than those in prod. Also clean up some bogus constructs. Comment about koji regen-repo is no longer valid since Koji implements dynamic on-demand repo regeneration. --- playbooks/manual/staging-sync/koji.yml | 5 ----- .../manual/staging-sync/templates/koji-reset-staging.sql | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/playbooks/manual/staging-sync/koji.yml b/playbooks/manual/staging-sync/koji.yml index 6db7f357ea..5f068a6173 100644 --- a/playbooks/manual/staging-sync/koji.yml +++ b/playbooks/manual/staging-sync/koji.yml @@ -64,10 +64,7 @@ tags: - db-sync-script - - postgresql_user: name=koji password={{ kojiPassword }} - when: env != "staging" - postgresql_user: name=koji password={{ kojiStgPassword }} - when: env == "staging" - postgresql_user: name=backup - postgresql_db: name=koji state=absent # buildroot_listing is excluded from the sync to save some time @@ -166,6 +163,4 @@ - name: Restart kojid service: name=kojid state=restarted -# TODO run createrepo for selected tags -# stgkoji regen-repo --nowait f29-build # TODO include playbooks to sync apps that use koji (koschei/bodhi/mbs/...) diff --git a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql index 508e53f8b3..981256348e 100644 --- a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql +++ b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql @@ -31,9 +31,9 @@ delete from imageinfo_listing; -- bump sequences (not strictly needed anymore) select now() as time, 'bumping sequences' as msg; -alter sequence task_id_seq restart with 140000000; -alter sequence repo_id_seq restart with 140000000; -alter sequence imageinfo_id_seq restart with 14000000; +alter sequence task_id_seq restart with 990000000; +alter sequence repo_id_seq restart with 990000000; +alter sequence imageinfo_id_seq restart with 990000000; -- truncate sessions select now() as time, 'truncating sessions' as msg;