-
Notifications
You must be signed in to change notification settings - Fork 23
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
[v14] Assigning to GUCs leads to server crash #45
Comments
Thank you for providing all the details upfront. I can reproduce the bug on 14, but not on 17. |
Regarding your patch... The functions you propose to exclude propagate the setting to shared memory, so that changing these affects all the clients. In other words, it affects the behavior of the extension, rather than seamlessly fixing the problem. |
Indeed, the patch I proposed does not directly fix this issue. This patch is a redesign of the implementation of What do you think about this proposal? I look forward to hearing your thoughts. Best regards! |
This extension is for debugging purposes, to identify queries causing the troubles. As the troubles show up, you connect to the database and see all the currently running statements. Not seeing all of them, or not knowing whether you see all of them would make the extension less useful. That is why The query plans appear in shared memory just before being executed in the format set in |
I got your point. The scenario you described is that, when it's not clear which is trouble query, the extension displays plans of all running statements to identify the trouble one. However, changing Another meaningful scenario for this extension is when we already know which is trouble query, but for various reasons, we cannot obtain its actual plan. For example, if we are unsure about the parameter types set by a query using extended protocol, the For a database used in actual business operations, By the way, there are more effective ways to identify trouble queries, such as using the |
Hello,
When using the
pg_show_plans
plugin, after I modified thepg_show_plans.id_enabled
parameter, I noticed that some core dump files were generated. The specific steps to reproduce and the stack trace are provided in the additional information.The process generating the core dump is not a regular backend process, but rather the SysLogger process. Based on the stack trace information, AFAICS, the SysLogger is not attached to shared memory (refer to the
SubPostmasterMain
function). Therefore, when executing thepg_show_plans.id_enabled
set_hook function, the segmentation fault occurs. Similar parameters includepg_show_plans.plan_format
.Let's return to the discussion of the functionality of these two parameters. The parameters allow users to modify them at the session level, but they modify shared memory without any lock protection, which is unreasonable. We might consider changing the parameters to the PGC_POSTMASTER level. However, in my opinion, it would be more reasonable if these were just regular parameters. I've included the implemented patch in the 0001-redesign-pg_show_plans.is_enabled-and-pg_show_plans..patch.
Regards
additional info:
14.13
sources
CentOS8
only pg_show_plans
shared_preload_libraries
value frompostgresql.conf
pg_show_plans
alter system set pg_show_plans.is_enabled to off
when instance running.select pg_reload_conf()
Then, a coredump file is produced.
the stack trace is
The text was updated successfully, but these errors were encountered: