Don't drop user related tables from Anitya's db dump #7298
Labels
No labels
announcement
authentication
automate
aws
backlog
blocked
bodhi
ci
Closed As
Duplicate
Closed As
Fixed
Closed As
Fixed with Explanation
Closed As
Initiative Worthy
Closed As
Insufficient data
Closed As
Invalid
Closed As
Spam
Closed As
Upstream
Closed As/Will Not
Can Not fix
cloud
communishift
copr
database
deprecated
dev
discourse
dns
downloads
easyfix
epel
factory2
firmitas
gitlab
greenwave
hardware
help wanted
high-gain
high-trouble
iad2
koji
koschei
lists
low-gain
low-trouble
mbs
medium-gain
medium-trouble
mini-initiative
mirrorlists
monitoring
Needs investigation
notifier
odcs
OpenShift
ops
OSBS
outage
packager_workflow_blocker
pagure
permissions
Priority
Needs Review
Priority
Next Meeting
Priority
🔥 URGENT 🔥
Priority
Waiting on Assignee
Priority
Waiting on External
Priority
Waiting on Reporter
rabbitmq
rdu-cc
release-monitoring
releng
repoSpanner
request-for-resources
s390x
security
SMTP
src.fp.o
staging
taiga
unfreeze
waiverdb
websites-general
wiki
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Infrastructure/fedora-infrastructure#7298
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I found out, that Anitya's dump is missing these tables:
"users"
"tokens"
"social_auth_association"
"social_auth_code"
"social_auth_nonce"
"social_auth_partial"
"social_auth_usersocialauth"
It will be better if you can just leave these tables empty instead of dropping them entirely.
When do you need this? (YYYY/MM/DD)
Asap
When is this no longer needed or useful? (YYYY/MM/DD)
If we cannot complete your request, what is the impact?
Current development environment for Anitya is using production dump and without these tables you are getting error every time application works with user (login, check if admin etc.)
Metadata Update from @bowlofeggs:
@zlopez This is the commit that made the change:
https://infrastructure.fedoraproject.org/cgit/ansible.git/commit/?id=f0c596c427cc591148634d31cbe521579fc462ff
You may be able to adjust it to insert the empty tables you desire, or you may be able to adjust the development environment to do so.
@bowlofeggs
I got advice from @mizdebsk on IRC, that this could be done by running
sed '/COPY table_name /,/\./d'
on dump. Is this possible, when the tables were excluded from actual dump?On Tue, 2018-10-09 at 14:24 +0000, Michal Kone=C4=8Dn=C3=BD wrote:
The database dump is a text file, so there are a variety of ways you
could edit it to add an empty version of the table to it.
Ok, I will then just play with it.
My idea was not to exclude these tables from pg_dump, but instead truncate them on-the-fly, eg with sed, i.e. replace
pg_dump -T users $DB | ...
withpg_dump $DB | sed '/COPY users /,/\./d' | ...
Note that these were dropped for security reasons, so make sure sensitive data isn't being published.
I think we can switch -T to --exclude-table-data for these tho and have the table exist, but have no data in it. Would that work?
@kevin This will be ideal
I've proposed a freeze break to do this (since db01 is frozen).
This is in place and theres a new dump that should be correct.
Let me know if it's not. 🚟
Metadata Update from @kevin:
Everything is working as expected. Thanks for the patch.