From a97de30d27c4c5f72ebfca89de2d1dedffd81b84 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Wed, 28 Feb 2018 17:30:20 +0000 Subject: [PATCH] Koji stg sync: run vacuum in a separate task --- playbooks/manual/staging-sync/koji.yml | 3 ++- playbooks/manual/staging-sync/templates/koji-reset-staging.sql | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/playbooks/manual/staging-sync/koji.yml b/playbooks/manual/staging-sync/koji.yml index 0daeecfe12..9d38e57c7b 100644 --- a/playbooks/manual/staging-sync/koji.yml +++ b/playbooks/manual/staging-sync/koji.yml @@ -71,10 +71,11 @@ # TODO: add pipe buffering - name: Import the prod db. This will take quite a while. Go get a snack! shell: curl https://infrastructure.fedoraproject.org/infra/db-dumps/koji.dump.xz | xzcat | sed '/COPY buildroot_listing /,/\./d' | psql koji -# TODO: move vacuum to a separate task # TODO: whap sql script in a transaction - name: repoint all the prod rpm entries at the secondary volume (and other stuff) shell: psql koji < /var/lib/pgsql/koji-reset-staging.sql + - name: vacuum database + shell: psql koji <<<"VACUUM ANALYZE" # TODO -- nuke old staging content in /mnt/fedora_koji/koji/ # TODO recreate directories under /mnt/fedora_koji/koji/ diff --git a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql index cdd3ed6b08..45ef0ab811 100644 --- a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql +++ b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql @@ -112,5 +112,3 @@ insert into user_perms (user_id, perm_id, active, creator_id) values ( update users set krb_principal='{{principal}}@STG.FEDORAPROJECT.ORG' where name='{{username}}'; {% endfor %} update users set krb_principal=replace(krb_principal, '@FEDORAPROJECT.ORG', '@STG.FEDORAPROJECT.ORG'); - -VACUUM ANALYZE;