Koji stg sync: run vacuum in a separate task

This commit is contained in:
Mikolaj Izdebski 2018-02-28 17:30:20 +00:00
parent 38786f14cf
commit a97de30d27
2 changed files with 2 additions and 3 deletions

View file

@ -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/

View file

@ -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;