-
Notifications
You must be signed in to change notification settings - Fork 308
Add the ability to self check the database. #1768
Conversation
Currently the self check fails on the production database because there are unexplained orphans. What shell we do with them?
Edit: Ordered from the newest (2013-12-05) to the oldest (2012-09-20). The oldest (64f4f959b322) is the only one claimed. |
How could have been the orphans above created?
To check the above mentioned cases:
So, where does that leave us? Another bug in |
git blame says that |
I'll try to do some forensics using the backups. Since we have the automatic capture on I'll try to compare the snapshot from 2013-11-30 and the one from 2013-12-05 or 2013-12-06 (which ever has the newest orphan). |
I ended up comparing 2013-11-29 and 2013-11-30. One of the changes looks suspicious and would explain why I haven't been able to find anything in the code. The timing of #54 (comment) nicely corresponds with the interval when the orphan appeared. @whit537 Can these orphans be some remains after hand-changes to the db to fulfill the account deactivation requests? Have you ever created a participant and/or deleted from elsewhere and/or reset elsewhere.participant to someone else? |
Also run self_check from the homepage updater thread. This way we should learn as soon as possible about new orphans by Sentry report.
Now the self_check passes on the production db. Turning it on in the homepage updater thread is an attempt to better identify the moment when the next orphan appears. Maybe that will give us a hit as to what is wrong. I now consider this pull request ready to review and/or merge. |
Sorry if this seems tiring but I have another problem 😉. I tried to add check that accounts that have been absorbed have no non zero outstanding tips. But account 4c074000c7bc has an outstanding non zero tip. What has happened is that the absorption occurred at second 26 while the new tip is from second 38. It has been created after the absorption. And from the point of view of take_over it is a self tip. The times are:
So... how could someone create a tip 12s after being singed out? The user has also managed to create 6 tips within 1s so most likely a script has been used. |
I am not able to find what code was online in May this year (take_over). I wanted to check if the code to reset the session has been part of take_over at that time. Anyway, I propose to remove the offending tip. I might come up with more self checks 😉 Edit: I've found it, the session reset was there. So I have no idea how that happened. |
This is awesome. I need to read it. |
This is great stuff. I'd love to have have a conversation with @zwn to walk through this code. |
Conflicts: configure-aspen.py gittip/testing/__init__.py tests/test_billing.py tests/test_charts_json.py
Conflicts: configure-aspen.py gittip/testing/__init__.py tests/test_billing.py tests/test_charts_json.py
Add the ability to self check the database.
Subclasses Postgres to prepare for write-wrapping for #1549
and to add self checks for #1118 and #1705.
Fixes #1118, #1705.