mirror of
https://github.com/zulip/zulip.git
synced 2026-06-12 21:00:58 +08:00
Updating the pgroonga package is not sufficient to upgrade the
extension in PostgreSQL -- an `ALTER EXTENSION pgroonga UPDATE` must
explicitly be run[^1]. Failure to do so can lead to unexpected behavior,
including crashes of PostgreSQL.
Expand on the existing `pgroonga_setup.sql.applied` file, to track
which version of the PostgreSQL extension has been configured. If the
file exists but is empty, we run `ALTER EXTENSION pgroonga UPDATE`
regardless -- if it is a no-op, it still succeeds with a `NOTICE`:
```
zulip=# ALTER EXTENSION pgroonga UPDATE;
NOTICE: version "3.0.8" of extension "pgroonga" is already installed
ALTER EXTENSION
```
The simple `ALTER EXTENSION` is sufficient for the
backwards-compatible case[^1] -- which, for our usage, is every
upgrade since 0.9 -> 1.0. Since version 1.0 was released in 2015,
before pgroonga support was added to Zulip in 2016, we can assume for
the moment that all pgroonga upgrades are backwards-compatible, and
not bother regenerating indexes.
Fixes: #25989.
[^1]: https://pgroonga.github.io/upgrade/
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| build-pgroonga | ||
| check_rabbitmq_queue.py | ||
| check-database-compatibility | ||
| clean_emoji_cache.py | ||
| clean_node_cache.py | ||
| clean_unused_caches.py | ||
| clean_venv_cache.py | ||
| create-production-venv | ||
| email-mirror-postfix | ||
| fix-standalone-certbot | ||
| hash_reqs.py | ||
| install | ||
| install-node | ||
| node_cache.py | ||
| puppet_cache.py | ||
| pythonrc.py | ||
| queue_workers.py | ||
| setup_path.py | ||
| setup_venv.py | ||
| setup-apt-repo | ||
| setup-yum-repo | ||
| sharding.py | ||
| supervisor.py | ||
| unpack-zulip | ||
| update-git-upstream | ||
| upgrade-zulip | ||
| upgrade-zulip-from-git | ||
| upgrade-zulip-stage-2 | ||
| warn-rabbitmq-nodename-change | ||
| zulip_tools.py | ||