New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new oldest_xmin check. #248
Conversation
As discussed off thread, I realized that I forgot to also handle the impacted databases. I just pushed an additional commit (that should be squashed, after a rebase I'll take care of that once everything is ok) to fix both that and @ioguix comments. |
Hey @rjuju, I've been reviewing and testing. I closed all our active conversations as we finished discussing all of them. I fixed a bug in the query were some Please, do some test/review and fixup/merge when you are ok. |
BTW, with only 4 connectable db (including Maybe we can add a |
+1 for a |
Thanks @ioguix I'll review the changes soon. |
As discussed on IRC, I added a few commits:
Please, review. ++ |
I'm fine with the new behavior. About the patch, I think we should document the new I also see that you don't check for compatibility with this option. Is that intended? I'm not sure if anyone will blindly add a |
Well, a lots of specifics argument are not documented with other, normal, ones. Specifics ones are only documented in their related service. Eg.:
Fixed in last commit. |
This implements the check mentioned in #201.
I'm not extremely sure of the pg_stat_activity part. The problems I can see are:
as soon as eg. a transaction retains some xid, active queries started after will also look like they're retaining the same amount of transactions. However, if t hose queries continue to run after the initial transaction is finished, they'll be the source of retention. So it's quite hard to really identify what actually retains the xmin horizons from an aggregated view. The query is already complex enough, so I'm not in favor of adding extra steps to try to be smarter about that.
For pg_stat_activity, I'm not exactly sure if both backend_xmin and backend_xid can both be earlier than the other. Minimal testing showed than
coalesce(backend_xmin, backend_xid)
was enough, but I certainly didn't try a lot of scenario.