You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Forced cache invalidation (CLOBBER_CACHE_ALWAYS) has been impracticalto use for testing in PostgreSQL because it's so slow and because it'stoggled on/off only at build time. It is helpful when hunting bugs inany code that uses the sycache/relcache because causes cacheinvalidations to be injected whenever it would be possible for aninvalidation to occur, whether or not one was really pending.Address this by providing run-time control over cache clobberbehaviour using the new debug_invalidate_system_caches_always GUC.Support is not compiled in at all unless assertions are enabled orCLOBBER_CACHE_ENABLED is explicitly defined at compile time. Itdefaults to 0 if compiled in, so it has negligible effect on assertbuild performance by default.When support is compiled in, test code can now setdebug_invalidate_system_caches_always=1 locally to a backend to testspecific queries, functions, extensions, etc. Or tests can toggle itglobally for a specific test case while retaining normal performanceduring test setup and teardown.For backwards compatibility with existing test harnesses and scripts,debug_invalidate_system_caches_always defaults to 1 ifCLOBBER_CACHE_ALWAYS is defined, and to 3 if CLOBBER_CACHE_RECURSIVEis defined.CLOBBER_CACHE_ENABLED is now visible in pg_config_manual.h, as is therelated RECOVER_RELATION_BUILD_MEMORY setting for the relcache.Author: Craig Ringer <craig.ringer@2ndquadrant.com>Discussion:https://www.postgresql.org/message-id/flat/CAMsr+YF=+ctXBZj3ywmvKNUjWpxmuTuUKuv-rgbHGX5i5pLstQ@mail.gmail.com