-
Notifications
You must be signed in to change notification settings - Fork 526
Allow pool_size per user #1049
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
Allow pool_size per user #1049
Conversation
|
|
||
| pool_mode | ||
| : The user's override pool_mode, or NULL if the default will be used instead. | ||
| : The user's override pool_mode, or NULL if not set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be a good idea to fix also the documentation of pool_mode. It was slightly misleading as it is not necessarily true that the default is used when pool_mode is not overridden for user. There still can be a setting of pool_mode at db level in which case the default is not used.
The same is true for pool_size starting this PR so I thought I would make the documentation of the two params practically identical.
Also the config.md#L1260-L1261 for the same param is stating this fact correctly already.
|
HI @JelteF, thank you for looking into this PR. Unfortunately, I had to revert this PR back to draft since as innocent as my changes look, they somehow managed to break Thanks |
|
This is weird. Even a dummy modification of It is reproducible though. I've created a patch that adds an additional branch to |
|
Patch mentioned in the previous comment: |
|
I can reproduce the error with your patch. But it goes away if I change the initial check to: if (pool->user && pool->user->connection_count > 999999999) // dummy condition that is never trueSo I guess, pool->user can be NULL when this function is called. And not checking for that is causing some strange undefined behaviour. |
|
Yeah, this field can indeed be NULL according to the stru PgUser *user; /* user logged in as, this field is NULL for peer pools */ |
durdina
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for feedback. I've incorporated much of it, for the documentation I left an explanation.
Also thanks for finding this one, I added logging inside |
Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
217d835 to
f1cb0c2
Compare
|
Hi @JelteF, I've incorporated your comments and this PR is probably ready for merging. What do you think? |
|
Hi mates! |
|
Hi @DrSchmurge, My advise would be picking this feature as a patch and applying it to the latest released version (which atm is 1.22.1) but I understand it might not be for everybody. CC: @JelteF |
Specifying
pool_sizeis now possible in section[users]beside[databases]or as a global param. Possibility of specifyingpool_sizein user configuration was requested in the associated issue. Resolves #911.Looking forward to discussing the implementation details or the issue ratioinale if needed.
Thanks,
Michal
Note: This is my first pull request for this project. I picked this issue as it was labeled as 'good-first-issue' and I wanted to get acquainted with the project.
Fixes #911
Partially fixes #166