Compare commits

..

2 Commits

Author SHA1 Message Date
Devon Hudson
7450052e60 Add changelog entry 2025-11-12 13:27:45 -07:00
Devon Hudson
a4345c391e Remove support for PostgreSQL 13. 2025-11-12 13:24:43 -07:00
8 changed files with 24 additions and 19 deletions

View File

@@ -72,7 +72,7 @@ trial_postgres_tests = [
{ {
"python-version": "3.10", "python-version": "3.10",
"database": "postgres", "database": "postgres",
"postgres-version": "13", "postgres-version": "14",
"extras": "all", "extras": "all",
}, },
{ {

View File

@@ -617,7 +617,7 @@ jobs:
matrix: matrix:
include: include:
- python-version: "3.10" - python-version: "3.10"
postgres-version: "13" postgres-version: "14"
- python-version: "3.14" - python-version: "3.14"
postgres-version: "17" postgres-version: "17"

View File

@@ -1 +0,0 @@
Point out which event caused the exception when checking [MSC4293](https://github.com/matrix-org/matrix-spec-proposals/pull/4293) redactions.

View File

@@ -0,0 +1 @@
Remove support for PostgreSQL 13.

View File

@@ -11,7 +11,7 @@ ARG SYNAPSE_VERSION=latest
ARG FROM=matrixdotorg/synapse-workers:$SYNAPSE_VERSION ARG FROM=matrixdotorg/synapse-workers:$SYNAPSE_VERSION
ARG DEBIAN_VERSION=trixie ARG DEBIAN_VERSION=trixie
FROM docker.io/library/postgres:13-${DEBIAN_VERSION} AS postgres_base FROM docker.io/library/postgres:14-${DEBIAN_VERSION} AS postgres_base
FROM $FROM FROM $FROM
# First of all, we copy postgres server from the official postgres image, # First of all, we copy postgres server from the official postgres image,
@@ -26,7 +26,7 @@ RUN adduser --system --uid 999 postgres --home /var/lib/postgresql
COPY --from=postgres_base /usr/lib/postgresql /usr/lib/postgresql COPY --from=postgres_base /usr/lib/postgresql /usr/lib/postgresql
COPY --from=postgres_base /usr/share/postgresql /usr/share/postgresql COPY --from=postgres_base /usr/share/postgresql /usr/share/postgresql
COPY --from=postgres_base --chown=postgres /var/run/postgresql /var/run/postgresql COPY --from=postgres_base --chown=postgres /var/run/postgresql /var/run/postgresql
ENV PATH="${PATH}:/usr/lib/postgresql/13/bin" ENV PATH="${PATH}:/usr/lib/postgresql/14/bin"
ENV PGDATA=/var/lib/postgresql/data ENV PGDATA=/var/lib/postgresql/data
# We also initialize the database at build time, rather than runtime, so that it's faster to spin up the image. # We also initialize the database at build time, rather than runtime, so that it's faster to spin up the image.

View File

@@ -117,6 +117,14 @@ each upgrade are complete before moving on to the next upgrade, to avoid
stacking them up. You can monitor the currently running background updates with stacking them up. You can monitor the currently running background updates with
[the Admin API](usage/administration/admin_api/background_updates.html#status). [the Admin API](usage/administration/admin_api/background_updates.html#status).
# Upgrading to v1.143.0
## Dropping support for PostgreSQL 13
In line with our [deprecation policy](deprecation_policy.md), we've dropped
support for PostgreSQL 13, as it is no longer supported upstream.
This release of Synapse requires PostgreSQL 14+.
# Upgrading to v1.142.0 # Upgrading to v1.142.0
## Python 3.10+ is now required ## Python 3.10+ is now required

View File

@@ -1600,21 +1600,18 @@ class EventsWorkerStore(SQLBaseStore):
if d: if d:
d.redactions.append(redacter) d.redactions.append(redacter)
# check for MSC4293 redactions # check for MSC4932 redactions
to_check = [] to_check = []
events: list[_EventRow] = [] events: list[_EventRow] = []
for e in evs: for e in evs:
try: event = event_dict.get(e)
event = event_dict.get(e) if not event:
if not event: continue
continue events.append(event)
events.append(event) event_json = json.loads(event.json)
event_json = json.loads(event.json) room_id = event_json.get("room_id")
room_id = event_json.get("room_id") user_id = event_json.get("sender")
user_id = event_json.get("sender") to_check.append((room_id, user_id))
to_check.append((room_id, user_id))
except Exception as exc:
raise InvalidEventError("Invalid event %s" % (event_id,)) from exc
# likely that some of these events may be for the same room/user combo, in # likely that some of these events may be for the same room/user combo, in
# which case we don't need to do redundant queries # which case we don't need to do redundant queries

View File

@@ -99,8 +99,8 @@ class PostgresEngine(
allow_unsafe_locale = self.config.get("allow_unsafe_locale", False) allow_unsafe_locale = self.config.get("allow_unsafe_locale", False)
# Are we on a supported PostgreSQL version? # Are we on a supported PostgreSQL version?
if not allow_outdated_version and self._version < 130000: if not allow_outdated_version and self._version < 140000:
raise RuntimeError("Synapse requires PostgreSQL 13 or above.") raise RuntimeError("Synapse requires PostgreSQL 14 or above.")
with db_conn.cursor() as txn: with db_conn.cursor() as txn:
txn.execute("SHOW SERVER_ENCODING") txn.execute("SHOW SERVER_ENCODING")