From 33f0da0509b2c2785a2a30f2189da54def8c062c Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Sun, 25 Jul 2021 23:59:38 -0500 Subject: [PATCH] Add no downtime schema cache reload --- releases/upcoming.rst | 3 +++ schema_cache.rst | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/releases/upcoming.rst b/releases/upcoming.rst index e64afadbb..3ab9d21c6 100644 --- a/releases/upcoming.rst +++ b/releases/upcoming.rst @@ -19,6 +19,9 @@ Added * Allow :ref:`embedding_view_chains` recursively to any depth. |br| -- `@wolfgangwalther `_ +* No downtime when reloading the schema cache. See the note in :ref:`schema_reloading`. + |br| -- `@steve-chavez `_ + * Allow schema cache reloading using PostgreSQL :ref:`NOTIFY ` command. |br| -- `@steve-chavez `_ diff --git a/schema_cache.rst b/schema_cache.rst index fe684b708..df8804d21 100644 --- a/schema_cache.rst +++ b/schema_cache.rst @@ -95,16 +95,19 @@ To refresh the cache without restarting the PostgREST server, send a SIGUSR1 sig killall -SIGUSR1 postgrest + +For docker you can do: + +.. code:: bash + + docker kill -s SIGUSR1 + + # or in docker-compose + docker-compose kill -s SIGUSR1 + .. note:: - To refresh the cache in docker: - - .. code:: bash - - docker kill -s SIGUSR1 - - # or in docker-compose - docker-compose kill -s SIGUSR1 + There's no downtime when reloading the schema cache. The reloading will happen on a background thread while requests keep being served. .. _schema_reloading_notify: