Skip to content

SIGHUP gucs doesn't seem to work #32

@Smyatkin-Maxim

Description

@Smyatkin-Maxim

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

  1. Create demo cluster
  2. Add extension to shared libraries
  3. Restart cluster
  4. Set restart_naptime to something small
  5. Restart again (so that naptime is applied and the current long sleep is broken)
  6. Use sighup (either alter system+ config reload from SQL, or gpconfig -c... + gpstop -au)
  7. 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

  1. That it really doesn't work now
  2. 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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions