Don't sync Koji buildroot listings in staging

buildroot_listing is by far the biggest table in koji db (>100 GB for
table data, plus indexes) and it's rarely used - skipping it saves us
some considerable amount of time.  If the table turns out to be
needed, the playbook can always be updated not to exclude it.
This commit is contained in:
Mikolaj Izdebski 2018-02-10 03:23:50 +00:00
parent 4891cfb03e
commit 1f694e6b5b

View file

@ -46,15 +46,14 @@
dest=/var/tmp/koji.dump.xz
owner=postgres
group=postgres
- command: unxz /var/tmp/koji.dump.xz
creates=/var/tmp/koji.dump
# TODO -- stop replication and wipe db's
- command: dropdb koji
- command: createdb -O koji koji
# buildroot_listing is excluded from the sync to save some time
- name: Import the prod db. This will take quite a while. Go get a snack!
shell: cat /var/tmp/koji.dump | psql koji
shell: xzcat /var/tmp/koji.dump.xz | sed '/COPY buildroot_listing /,/\./d' | psql koji
- name: repoint all the prod rpm entries at the secondary volume (and other stuff)
shell: psql koji < /var/lib/pgsql/koji-reset-staging.sql