All the options in gp_relsizes_stats are defined as SIGHUP, which makes sense. But as far as I understand it, background workers should explicitly define signal handler for sighup and add points for config reload.
Examples can be found in many GP/PG extensions. See this code for signal redifinition and this code for config reload in worker_spi.c (postgres example on how to write workers).
We need to add a points where the config should be applied. Usually it's a main worker loop. I suggest doing it right before checking for extension enabled status so that it get's updated.
How to verify
- Create demo cluster
- Add extension to shared libraries
- Restart cluster
- Set
restart_naptime to something small
- Restart again (so that naptime is applied and the current long sleep is broken)
- Use sighup (either
alter system+ config reload from SQL, or gpconfig -c... + gpstop -au)
- Wait for timeout to pass and check that table sizes are populated (for more debugging feel free to add logs on "enabled change" to main worker loop or add custom signal handlers in gdb)
What to verify
- That it really doesn't work now
- That all parameters are working as expected after the fix
Nice to do
There might be another semi-reliated bug: it appears that here we're waiting to restart_naptimeeven if the extension is disabled. That's bad, cuz whenever we update config we will have to wait for this timeout for the change to apply. Imagine a situation where you've installed extension with default naptime = 6 hours and you want to reconfigure it so that a) it's enabled and b) it runs every hour. You issue SIGHUP but still gona wait for 6 hour for the old timeout to pass. To fix this, we should sleep for some (smaller and non-configurable) time (for example, 10s) in caseenabled = false`
All the options in gp_relsizes_stats are defined as SIGHUP, which makes sense. But as far as I understand it, background workers should explicitly define signal handler for sighup and add points for config reload.
Examples can be found in many GP/PG extensions. See this code for signal redifinition and this code for config reload in worker_spi.c (postgres example on how to write workers).
We need to add a points where the config should be applied. Usually it's a main worker loop. I suggest doing it right before checking for extension enabled status so that it get's updated.
How to verify
restart_naptimeto something smallalter system+config reloadfrom SQL, orgpconfig -c...+gpstop -au)What to verify
Nice to do
There might be another semi-reliated bug: it appears that here we're waiting to restart_naptime
even if the extension is disabled. That's bad, cuz whenever we update config we will have to wait for this timeout for the change to apply. Imagine a situation where you've installed extension with default naptime = 6 hours and you want to reconfigure it so that a) it's enabled and b) it runs every hour. You issue SIGHUP but still gona wait for 6 hour for the old timeout to pass. To fix this, we should sleep for some (smaller and non-configurable) time (for example, 10s) in caseenabled = false`