From 9a12f6bf7924645f3e5dc3f3740aedf682795223 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Wed, 28 Feb 2018 17:31:31 +0000 Subject: [PATCH] Run koji-reset-staging.sql in a single db transaction If the script fails for some reason, we want DB to be in consistent state so that the script can be fixed and re-ran more easily. --- playbooks/manual/staging-sync/koji.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/playbooks/manual/staging-sync/koji.yml b/playbooks/manual/staging-sync/koji.yml index 9d38e57c7b..98041b62e8 100644 --- a/playbooks/manual/staging-sync/koji.yml +++ b/playbooks/manual/staging-sync/koji.yml @@ -71,9 +71,8 @@ # 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: 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 + shell: psql -1 koji