From ccc4398af11f2a474f197793b99237938e10918e Mon Sep 17 00:00:00 2001 From: James Chapman Date: Wed, 18 Nov 2026 00:55:23 +0000 Subject: [PATCH 1/3] Give SQLite writes one pooled connection so a write never waits in SQLite's busy handler for another (1.1.4) The DB-7 scenario lost three of 64 writes under load: three pooled SQLite connections being opened polled SQLite's busy handler for the first one's lock, lost to its back-to-back commits (every journal and database sync runs under EXCLUSIVE) and were refused after 5 s with SQLITE_BUSY. SQLite runs one write at a time, so the SQLite write pool now holds one connection whatever database.pool_size says, and writers wait in the pool instead (ADR-0834). database.pool_size applies to PostgreSQL only. A new scenario holds SQLite's write lock on a leased pool slot for 7 s while a second write runs; on the old code that write was refused at BEGIN IMMEDIATE after the busy timeout. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 21 ++++ .../0154-pool-database-write-connections.md | 5 + ...lite-writes-share-one-pooled-connection.md | 86 +++++++++++++++++ docs/adr/index.md | 1 + docs/database-persistence.md | 6 +- docs/user-manual.md | 2 +- .../merovingian/database/PersistentStore.hpp | 20 ++-- .../merovingian/database/SqliteWritePool.hpp | 11 ++- meson.build | 2 +- packaging/freebsd/+MANIFEST | 2 +- packaging/netbsd/Makefile | 2 +- packaging/opensuse/merovingian.spec | 5 +- packaging/rhel/merovingian.spec | 5 +- packaging/rpm/merovingian.spec | 5 +- scripts/build-deb.sh | 4 +- scripts/build-freebsd-pkg.sh | 4 +- scripts/build-netbsd-pkg.sh | 4 +- scripts/build-openbsd-pkg.sh | 4 +- scripts/build-opensuse-rpm.sh | 4 +- scripts/build-rhel-rpm.sh | 4 +- scripts/build-rpm.sh | 4 +- scripts/build-static-linux.sh | 2 +- src/database/AGENTS.md | 4 +- src/database/PersistentStore.cpp | 5 +- src/database/SqliteStore.cpp | 13 +-- src/db_migrate.cpp | 2 +- src/main.cpp | 2 +- .../test_security_audit_write_pool_flow.cpp | 95 ++++++++++++++++++- 28 files changed, 270 insertions(+), 54 deletions(-) create mode 100644 docs/adr/0834-sqlite-writes-share-one-pooled-connection.md diff --git a/CHANGELOG.md b/CHANGELOG.md index c685c194d..cda174ed3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ Changes from 1.0.0, the first production release, onwards; the format is set out Changes before 1.0.0 are in [CHANGELOG-pre-release.md](CHANGELOG-pre-release.md), which is no longer added to ([ADR-0740](docs/adr/0740-the-changelog-starts-at-1-0-0-and-the-pre-release-entries-are-a-frozen-record.md)). +# Version 1.1.4 + +## Features + +* None. + +## Security Fixes + +* None. + +## Bug fixes + +* SQLite writes share one connection, whatever `database.pool_size` says: a second write connection waited for the + first's lock by polling, lost to its back-to-back commits and was refused after 5 s, failing the write (ADR-0834). + +## Release notes + +1.1.4 stops a SQLite server from refusing writes under sustained write load. Writes now wait their turn on the one +SQLite write connection instead of racing for SQLite's lock on several and failing after 5 s. `database.pool_size` +now applies to PostgreSQL only. No configuration change is needed. + # Version 1.1.3 ## Features diff --git a/docs/adr/0154-pool-database-write-connections.md b/docs/adr/0154-pool-database-write-connections.md index 9723e3485..14c3bff0f 100644 --- a/docs/adr/0154-pool-database-write-connections.md +++ b/docs/adr/0154-pool-database-write-connections.md @@ -48,3 +48,8 @@ copies of it; `bootstrap_local_database` applies `database.pool_size` through a fresh connection dying mid-transaction always did. * A replaced SQLite file is not reopened by pooled handles until restart (they keep the file they opened, which is also what the DB-10 no-follow checks protected). + +## Links + +* Refined by [ADR-0834](0834-sqlite-writes-share-one-pooled-connection.md): SQLite writes use one pooled connection, + because the busy timeout does not absorb contention between this process's own connections. diff --git a/docs/adr/0834-sqlite-writes-share-one-pooled-connection.md b/docs/adr/0834-sqlite-writes-share-one-pooled-connection.md new file mode 100644 index 000000000..a8de083e7 --- /dev/null +++ b/docs/adr/0834-sqlite-writes-share-one-pooled-connection.md @@ -0,0 +1,86 @@ +# SQLite writes share one pooled connection, whatever database.pool_size says + +* Status: accepted +* Date: 2026-11-18 + +Technical Story: the DB-7 scenario "concurrent writes to SQLite reuse at most database.pool_size connections" lost +three of its 64 writes in a full test run on a loaded VM: three writers logged `connection.rejected sqlite_code=5` +and `transaction.failed stage=open` together, 5.3 s after the store opened. Refines +[ADR-0154](0154-pool-database-write-connections.md), which assumed that SQLite's 5-second busy timeout absorbs +contention for its single writer lock. + +## Context and Problem Statement + +SQLite in rollback-journal mode (`journal_mode = DELETE`, pinned by every connection) has one writer at a time, +and a connection that wants a lock another connection holds does not queue for it. Its busy handler polls: it +sleeps 1, 2, 5 ... ms, then every 100 ms, and gives up after 5 s of sleeps (`sqliteDefaultBusyCallback`). A +committing connection holds PENDING or EXCLUSIVE for the whole commit, journal syncs, database write and database +sync included (`syncJournal` takes EXCLUSIVE before its first sync), and PENDING refuses every new SHARED lock. A +pooled connection that commits back to back therefore holds the lock nearly all the time. Its next lease takes the +lock again within microseconds, while another connection of the same process, polling every 100 ms by then, +rarely arrives in the gap. + +With `database.pool_size` connections allowed, the pool opened a second, third and fourth SQLite connection while +the first was committing. Each needs a SHARED lock to read the schema when it pins its pragmas, and each of +them polled against the first for 5 s and was refused: a write the client is told failed, because another write of +the same process was busy. The same refusal follows for a write that waits behind one slow write for longer than +5 s. + +Should SQLite writes keep up to `database.pool_size` connections? + +## Considered Options + +* **One SQLite write connection: the SQLite write pool's limit is always 1 (chosen).** +* Keep `database.pool_size` connections and lengthen the busy timeout, or retry a refused open. +* Keep `database.pool_size` connections and serialise their transactions with a mutex. +* Write-ahead logging (`journal_mode = WAL`). + +## Decision Outcome + +Chosen option: one connection, because SQLite runs one write transaction at a time anyway, so a second connection +adds no parallelism and only a second place to wait, and that place is SQLite's polling, unfair, time-limited +busy handler. With one connection, every write of this process waits in the pool, on a condition variable that +wakes the next writer when a lease ends and never times out, which is how ADR-0154 already waits for a PostgreSQL +connection. + +* `SqliteWritePool` holds a `ConnectionPool` of limit 1, and `set_write_connection_limit` (that is, + `database.pool_size`) changes only the PostgreSQL pool. `write_connections_opened` reports 1 for SQLite unless a + connection could not be opened. +* SQLite's busy timeout still governs this process's reads against its writer, and every lock another process + takes (`merovingian-db-migrate`, an operator's `sqlite3` shell). A read can still be refused after 5 s of + back-to-back commits; that is not changed here. + +### Positive Consequences + +* No write is refused because another write of this process holds SQLite's lock, however long it holds it. +* A waiting writer is woken when the lease ends rather than at its next poll, and does no busy polling. + +### Negative Consequences + +* A write that never ends blocks every later write instead of failing them after 5 s each. A write is one + transaction of statements built before the lease is taken, so nothing in it waits on anything but SQLite. + +## Pros and Cons of the Options + +### Lengthen the busy timeout, or retry a refused open + +* Good, because it is a one-line change. +* Bad, because the wait stays unfair: a longer budget lowers the odds of a refusal under load but keeps it, and + every waiter polls. It raises the tolerance instead of removing the contention. + +### Several connections, serialised by a mutex + +* Bad, because the connections would never be used at once; the extra handles are idle weight, and + `database.pool_size` would claim a parallelism that does not exist. + +### Write-ahead logging + +* Good, because readers would no longer block a writer or be blocked by one. +* Bad, because the read-only connections refuse WAL on purpose + ([ADR-0157](0157-never-open-a-sqlite-database-file-outside-sqlite.md): a read-only connection can still write + the WAL index), and the pinned journal mode is a durability decision (#447). Changing them is a decision of its + own. + +## Links + +* Refines [ADR-0154](0154-pool-database-write-connections.md) diff --git a/docs/adr/index.md b/docs/adr/index.md index a045c32a5..15221e55c 100644 --- a/docs/adr/index.md +++ b/docs/adr/index.md @@ -712,3 +712,4 @@ * [0831 - A federated LiveKit token request is judged by main and answered subscribe-only](0831-a-federated-livekit-token-request-is-judged-by-main-and-answered-subscribe-only.md) * [0832 - A delegated delayed leave is restarted while LiveKit shows the participant, and sent once it does not](0832-a-delegated-delayed-leave-is-restarted-while-livekit-shows-the-participant-and-sent-once-it-does-not.md) * [0833 - The LiveKit webhook is served on the client listener and trusted only to prompt a check](0833-the-livekit-webhook-is-served-on-the-client-listener-and-trusted-only-to-prompt-a-check.md) +* [0834 - SQLite writes share one pooled connection, whatever database.pool_size says](0834-sqlite-writes-share-one-pooled-connection.md) diff --git a/docs/database-persistence.md b/docs/database-persistence.md index a2ec03e18..137aee4b3 100644 --- a/docs/database-persistence.md +++ b/docs/database-persistence.md @@ -1353,7 +1353,11 @@ membership is `invite` or `knock`, or deletes it; a new reader must check the me ### Write connection pool (DB-7, 0.12.26) Persisted writes reuse connections from a per-store `ConnectionPool` instead of opening one per -transaction: at most `database.pool_size` (16) are in use at once, and a write waits for a free one. +transaction, and a write waits for a free one. On PostgreSQL at most `database.pool_size` (16) are in use at +once. On SQLite there is always exactly one write connection, whatever `database.pool_size` says (ADR-0834): +SQLite runs one write transaction at a time, and a second connection of this process waiting for the first's +lock would poll SQLite's busy handler, lose to the first connection's back-to-back commits and be refused after +5 s. Writers wait in the pool instead, without a time limit, and are woken in turn. PostgreSQL connections assume the runtime role once when opened; a pooled one is reused only while idle (`PQTRANS_IDLE`) with nothing to read on its socket, so one the server has closed is replaced. SQLite connections keep their pragmas and `foreign_keys=ON`. Reads, migrations and the worker's read-only store diff --git a/docs/user-manual.md b/docs/user-manual.md index f671a47bb..262b4ac65 100644 --- a/docs/user-manual.md +++ b/docs/user-manual.md @@ -1296,7 +1296,7 @@ federation port `8448`. | `database.role` | `runtime` | Use `migration` only with `merovingian-db-migrate`. | | `database.migration_role` | (empty) | PostgreSQL role assumed for the DDL/migration phase only. Must be set together with `database.runtime_role`. | | `database.runtime_role` | (empty) | PostgreSQL role assumed to serve requests, dropping DDL rights. Both empty issues no `SET ROLE`, leaving an existing single-role deployment unchanged. | -| `database.pool_size` | `16` | Database connections persisted writes keep and use at once; a write waits for a free one rather than opening another (DB-7, ADR-0154). Requires restart. | +| `database.pool_size` | `16` | PostgreSQL connections persisted writes keep and use at once; a write waits for a free one rather than opening another (DB-7, ADR-0154). SQLite writes always share one connection, since SQLite runs one write at a time (ADR-0834). Requires restart. | | `database.sqlite_path` | `/var/lib/merovingian/merovingian.sqlite3` | Path for SQLite single-file store. Commented out in the shipped example, which defaults to PostgreSQL. The file itself must not be a symlink and is created `0600`; missing directories are created `0700`. Directories that already exist may be symlinks (for example `/var/lib/merovingian` pointing at a data volume). | #### PostgreSQL TLS admission diff --git a/include/merovingian/database/PersistentStore.hpp b/include/merovingian/database/PersistentStore.hpp index 7c4a77fa5..5a30fc22e 100644 --- a/include/merovingian/database/PersistentStore.hpp +++ b/include/merovingian/database/PersistentStore.hpp @@ -259,10 +259,10 @@ struct PersistentStoreOpenResult; namespace detail { // DB-7, ADR-0154: each backend's pool of write connections, defined in its - // own source file. Shared, not copied, by copies of a store. + // own source file. Shared, not copied, by copies of a store. Only the + // PostgreSQL pool's limit can be set: SQLite's is one (ADR-0834). struct SqliteWritePool; struct PostgresqlWritePool; - auto set_write_pool_limit(SqliteWritePool& pool, std::uint32_t limit) -> void; auto set_write_pool_limit(PostgresqlWritePool& pool, std::uint32_t limit) -> void; [[nodiscard]] auto write_pool_opened(SqliteWritePool const& pool) -> std::uint64_t; [[nodiscard]] auto write_pool_opened(PostgresqlWritePool const& pool) -> std::uint64_t; @@ -659,10 +659,11 @@ struct PersistentStore final // stripe locks because capture access is independent of any room. Held by // value (ADR-0517) so PersistentStore stays copyable and moveable; a copy gets its own mutex. core::CopyableMutex statement_capture_mutex{}; - // DB-7, ADR-0154: persisted writes reuse at most this many connections - // (database.pool_size, applied by set_write_connection_limit), instead of - // opening one per transaction. The pool of the store's backend is created - // when the store is opened; copies share it. + // DB-7, ADR-0154: persisted writes to PostgreSQL reuse at most this many + // connections (database.pool_size, applied by set_write_connection_limit), + // instead of opening one per transaction; SQLite writes reuse one + // (ADR-0834). The pool of the store's backend is created when the store is + // opened; copies share it. std::uint32_t write_connection_limit{16U}; std::shared_ptr sqlite_write_pool{}; // SHARED_PTR: reviewed - shared by store copies. std::shared_ptr // SHARED_PTR: reviewed - shared by store copies. @@ -744,9 +745,10 @@ static_assert(std::is_nothrow_move_constructible_v && [[nodiscard]] auto validate_persistent_store(PersistentStore const& store) -> MigrationValidationResult; [[nodiscard]] auto commit_persistent_transaction(PersistentStore& store, std::vector const& statements) -> bool; -// DB-7, ADR-0154: caps the connections persisted writes keep and use at once -// (database.pool_size). A write waits for a free connection rather than opening -// another. Takes effect for the next write. +// DB-7, ADR-0154: caps the PostgreSQL connections persisted writes keep and use +// at once (database.pool_size). A write waits for a free connection rather than +// opening another. Takes effect for the next write. SQLite writes always share +// one connection and ignore it (ADR-0834). auto set_write_connection_limit(PersistentStore& store, std::uint32_t limit) -> void; // Connections ever opened for persisted writes (both backends' pools). [[nodiscard]] auto write_connections_opened(PersistentStore const& store) -> std::uint64_t; diff --git a/include/merovingian/database/SqliteWritePool.hpp b/include/merovingian/database/SqliteWritePool.hpp index 045c9072c..3a6b6ab7c 100644 --- a/include/merovingian/database/SqliteWritePool.hpp +++ b/include/merovingian/database/SqliteWritePool.hpp @@ -10,10 +10,17 @@ namespace merovingian::database::detail { +// ADR-0834: one SQLite write connection, whatever database.pool_size says. +// SQLite runs one write transaction at a time; a second connection of this +// process would wait for the first's lock in SQLite's polling busy handler, +// lose to its back-to-back commits and be refused after 5 s. Writers wait in +// the pool instead, without a time limit. struct SqliteWritePool final { - explicit SqliteWritePool(std::uint32_t limit) - : pool{limit} + static constexpr auto connection_limit = std::uint32_t{1U}; + + SqliteWritePool() + : pool{connection_limit} { } ConnectionPool pool; diff --git a/meson.build b/meson.build index 887a3f69f..2cce404da 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'merovingian', 'cpp', 'c', - version: '1.1.3', + version: '1.1.4', license: 'GPL-3.0-or-later', meson_version: '>=1.1.0', default_options: [ diff --git a/packaging/freebsd/+MANIFEST b/packaging/freebsd/+MANIFEST index 77d305136..68e179096 100644 --- a/packaging/freebsd/+MANIFEST +++ b/packaging/freebsd/+MANIFEST @@ -1,5 +1,5 @@ name: "merovingian" -version: "1.1.3" +version: "1.1.4" origin: net/merovingian comment: Secure Matrix Protocol homeserver desc: "Merovingian is a Matrix Protocol homeserver." diff --git a/packaging/netbsd/Makefile b/packaging/netbsd/Makefile index 172afbb90..ae9ba93a1 100644 --- a/packaging/netbsd/Makefile +++ b/packaging/netbsd/Makefile @@ -1,4 +1,4 @@ -DISTNAME= merovingian-1.1.3 +DISTNAME= merovingian-1.1.4 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_GITHUB:=OMG-Software/} GITHUB_PROJECT= Merovingian diff --git a/packaging/opensuse/merovingian.spec b/packaging/opensuse/merovingian.spec index ad696ac3b..9033a7f3a 100644 --- a/packaging/opensuse/merovingian.spec +++ b/packaging/opensuse/merovingian.spec @@ -1,5 +1,5 @@ Name: merovingian -Version: 1.1.3 +Version: 1.1.4 Release: 1%{?dist} Summary: Secure Matrix Protocol homeserver @@ -115,6 +115,9 @@ fi %{_sysconfdir}/merovingian/merovingian.conf.example %changelog +* Wed Nov 18 2026 James Chapman - 1.1.4-1 +- Merovingian 1.1.4 + * Tue Nov 17 2026 James Chapman - 1.1.3-1 - Merovingian 1.1.3 diff --git a/packaging/rhel/merovingian.spec b/packaging/rhel/merovingian.spec index c1833789f..55b38e1c3 100644 --- a/packaging/rhel/merovingian.spec +++ b/packaging/rhel/merovingian.spec @@ -1,5 +1,5 @@ Name: merovingian -Version: 1.1.3 +Version: 1.1.4 Release: 1%{?dist} Summary: Secure Matrix Protocol homeserver @@ -100,6 +100,9 @@ fi %{_sysconfdir}/merovingian/merovingian.conf.example %changelog +* Wed Nov 18 2026 James Chapman - 1.1.4-1 +- Merovingian 1.1.4 + * Tue Nov 17 2026 James Chapman - 1.1.3-1 - Merovingian 1.1.3 diff --git a/packaging/rpm/merovingian.spec b/packaging/rpm/merovingian.spec index 2291e8410..ee2ab3e7f 100644 --- a/packaging/rpm/merovingian.spec +++ b/packaging/rpm/merovingian.spec @@ -1,5 +1,5 @@ Name: merovingian -Version: 1.1.3 +Version: 1.1.4 Release: 1%{?dist} Summary: Secure Matrix Protocol homeserver @@ -104,6 +104,9 @@ fi %{_sysconfdir}/merovingian/merovingian.conf.example %changelog +* Wed Nov 18 2026 James Chapman - 1.1.4-1 +- Merovingian 1.1.4 + * Tue Nov 17 2026 James Chapman - 1.1.3-1 - Merovingian 1.1.3 diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh index 40460537a..4139b9f5d 100755 --- a/scripts/build-deb.sh +++ b/scripts/build-deb.sh @@ -1,9 +1,9 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build for merovingian 1.1.3. +# Build for merovingian 1.1.4. set -e -VERSION="1.1.3" +VERSION="1.1.4" PKG_NAME="merovingian" STAGING="staging-deb" diff --git a/scripts/build-freebsd-pkg.sh b/scripts/build-freebsd-pkg.sh index 67bb69112..15db5aac7 100755 --- a/scripts/build-freebsd-pkg.sh +++ b/scripts/build-freebsd-pkg.sh @@ -1,9 +1,9 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build for merovingian 1.1.3. +# Build for merovingian 1.1.4. set -e -VERSION="1.1.3" +VERSION="1.1.4" STAGING="staging-fbsd" # Clean any state (staged files, build dir) from cached FreeBSD VM runs. diff --git a/scripts/build-netbsd-pkg.sh b/scripts/build-netbsd-pkg.sh index 5022a7975..dc3c13451 100644 --- a/scripts/build-netbsd-pkg.sh +++ b/scripts/build-netbsd-pkg.sh @@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build for merovingian 1.1.3. +# Build for merovingian 1.1.4. # # The checked-in packaging/netbsd/Makefile is the pkgsrc recipe kept for # downstream porters. This script generates a framework-free package so CI @@ -11,7 +11,7 @@ # a staged tree using tar, which produces a package that pkg_add can install. set -e -VERSION="1.1.3" +VERSION="1.1.4" STAGE="staging-netbsd" PREFIX=/usr/pkg diff --git a/scripts/build-openbsd-pkg.sh b/scripts/build-openbsd-pkg.sh index f0b043f10..08c14d560 100644 --- a/scripts/build-openbsd-pkg.sh +++ b/scripts/build-openbsd-pkg.sh @@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build for merovingian 1.1.3. +# Build for merovingian 1.1.4. # # Standalone pkg_create(1), no ports tree. The checked-in packaging/openbsd/PLIST # is the ports-framework packing list kept for downstream porters; this script @@ -8,7 +8,7 @@ # produce and validate an installable package on every run. set -e -VERSION="1.1.3" +VERSION="1.1.4" STAGE="staging-openbsd" PREFIX=/usr/local diff --git a/scripts/build-opensuse-rpm.sh b/scripts/build-opensuse-rpm.sh index e2e5e79cb..0391a7dbf 100644 --- a/scripts/build-opensuse-rpm.sh +++ b/scripts/build-opensuse-rpm.sh @@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build an RPM package for merovingian 1.1.3 on OpenSUSE Tumbleweed or Leap. +# Build an RPM package for merovingian 1.1.4 on OpenSUSE Tumbleweed or Leap. # # Uses packaging/opensuse/merovingian.spec which adapts BuildRequires to # OpenSUSE package names (libopenssl-devel, postgresql-devel, libpng16-devel, @@ -12,7 +12,7 @@ # (.leap16, ADR-0650). set -e -VERSION="1.1.3" +VERSION="1.1.4" DIST="${MEROVINGIAN_RPM_DIST:-.tumbleweed}" case "${DIST}" in .[a-z]*) ;; diff --git a/scripts/build-rhel-rpm.sh b/scripts/build-rhel-rpm.sh index ab43f76bb..3b8881761 100644 --- a/scripts/build-rhel-rpm.sh +++ b/scripts/build-rhel-rpm.sh @@ -1,13 +1,13 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build an RPM package for merovingian 1.1.3 targeting RHEL 10 / AlmaLinux 10. +# Build an RPM package for merovingian 1.1.4 targeting RHEL 10 / AlmaLinux 10. # # Differs from build-rpm.sh only in the spec file used: packaging/rhel/merovingian.spec # omits catch-devel from BuildRequires (Catch2 is not reliably available in EPEL 10 # and is not needed when -Dbuild_tests=false). set -e -VERSION="1.1.3" +VERSION="1.1.4" mkdir -p "${HOME}/rpmbuild/BUILD" mkdir -p "${HOME}/rpmbuild/BUILDROOT" diff --git a/scripts/build-rpm.sh b/scripts/build-rpm.sh index 91a7ebacf..b767048dd 100755 --- a/scripts/build-rpm.sh +++ b/scripts/build-rpm.sh @@ -1,9 +1,9 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build an RPM package for merovingian 1.1.3 using rpmbuild. +# Build an RPM package for merovingian 1.1.4 using rpmbuild. set -e -VERSION="1.1.3" +VERSION="1.1.4" # 1. Create rpmbuild directory tree mkdir -p "${HOME}/rpmbuild/BUILD" diff --git a/scripts/build-static-linux.sh b/scripts/build-static-linux.sh index 455810c6a..76e629513 100755 --- a/scripts/build-static-linux.sh +++ b/scripts/build-static-linux.sh @@ -3,7 +3,7 @@ # Build a portable Linux fallback tarball with musl-linked static PIE binaries. set -eu -VERSION="${MEROVINGIAN_VERSION:-1.1.3}" +VERSION="${MEROVINGIAN_VERSION:-1.1.4}" BUILD_DIR="${BUILD_DIR:-build-static-linux}" STAGING="staging-static-linux" PACKAGE_ROOT="merovingian-${VERSION}-linux-static-x86_64" diff --git a/src/database/AGENTS.md b/src/database/AGENTS.md index 5d935b3eb..76e143364 100644 --- a/src/database/AGENTS.md +++ b/src/database/AGENTS.md @@ -61,7 +61,9 @@ Manages schema migrations and provides a dual-backend (SQLite / PostgreSQL) pers `actor`, `target` and `reason` to 255 bytes on a UTF-8 boundary (`observability::bounded_utf8`). 7. **Persisted writes lease a pooled connection; nothing else opens one per write.** `commit_persistent_transaction` - goes through the store's `ConnectionPool` (at most `database.pool_size` in use, ADR-0154). Hold a lease for exactly + goes through the store's `ConnectionPool` (at most `database.pool_size` in use on PostgreSQL, ADR-0154; exactly one + on SQLite, ADR-0834: never give SQLite a second write connection, whose wait for the first's lock is SQLite's + polling busy handler, which loses to back-to-back commits and refuses the write after 5 s). Hold a lease for exactly one transaction and never take another lease while holding one, or writers can deadlock waiting for each other. A PostgreSQL connection is reused only while idle with nothing to read on its socket. Main's reads for a federation worker (room list, room snapshots) lease a reader from `SnapshotReaderPool`, opened diff --git a/src/database/PersistentStore.cpp b/src/database/PersistentStore.cpp index 49599829e..2b75aa14d 100644 --- a/src/database/PersistentStore.cpp +++ b/src/database/PersistentStore.cpp @@ -536,10 +536,7 @@ namespace auto set_write_connection_limit(PersistentStore& store, std::uint32_t limit) -> void { store.write_connection_limit = std::max(limit, std::uint32_t{1U}); - if (store.sqlite_write_pool != nullptr) - { - detail::set_write_pool_limit(*store.sqlite_write_pool, store.write_connection_limit); - } + // The SQLite write pool keeps its one connection (ADR-0834). if (store.postgresql_write_pool != nullptr) { detail::set_write_pool_limit(*store.postgresql_write_pool, store.write_connection_limit); diff --git a/src/database/SqliteStore.cpp b/src/database/SqliteStore.cpp index 66e92f90a..53dd1de07 100644 --- a/src/database/SqliteStore.cpp +++ b/src/database/SqliteStore.cpp @@ -1670,11 +1670,6 @@ namespace namespace detail { - auto set_write_pool_limit(SqliteWritePool& pool, std::uint32_t limit) -> void - { - pool.pool.set_limit(limit); - } - auto write_pool_opened(SqliteWritePool const& pool) -> std::uint64_t { return pool.pool.opened_total(); @@ -1768,7 +1763,7 @@ auto open_sqlite_persistent_store(std::string const& path, TableLoadProfile prof store.sqlite_read_only = read_only; if (!read_only) { - store.sqlite_write_pool = std::make_shared(store.write_connection_limit); + store.sqlite_write_pool = std::make_shared(); } store.schema = load_schema_state(sqlite); log_diagnostic("store.schema_loaded", @@ -1923,8 +1918,10 @@ namespace detail auto connection = open_writer(); return connection.has_value() && execute_transaction(**connection, statements); } - // DB-7, ADR-0154: reuse a pooled connection; a SQLite handle stays usable - // after a failed transaction (execute_transaction rolls back). + // DB-7, ADR-0154: reuse the pooled connection; a SQLite handle stays usable + // after a failed transaction (execute_transaction rolls back). There is one + // (ADR-0834), so a writer waits here for the one before it, never in + // SQLite's busy handler against another connection of this process. auto lease = store.sqlite_write_pool->pool.acquire(open_writer, [](SqliteConnection const&) { return true; }); diff --git a/src/db_migrate.cpp b/src/db_migrate.cpp index 8ed212e6a..01099f901 100644 --- a/src/db_migrate.cpp +++ b/src/db_migrate.cpp @@ -23,7 +23,7 @@ namespace { -constexpr auto version = std::string_view{"1.1.3"}; +constexpr auto version = std::string_view{"1.1.4"}; auto print_help() -> void { diff --git a/src/main.cpp b/src/main.cpp index cd01db309..6d4dd3fd9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -83,7 +83,7 @@ namespace { -constexpr auto version = std::string_view{"1.1.3"}; +constexpr auto version = std::string_view{"1.1.4"}; struct BootstrapConfigResult final { diff --git a/tests/integration/test_security_audit_write_pool_flow.cpp b/tests/integration/test_security_audit_write_pool_flow.cpp index 05637d98f..f592ee446 100644 --- a/tests/integration/test_security_audit_write_pool_flow.cpp +++ b/tests/integration/test_security_audit_write_pool_flow.cpp @@ -3,16 +3,20 @@ // DB-7 (29 Sep 2026 audit): every persisted write opened a fresh database // connection (SQLite open with its path checks, or a PostgreSQL connect and // SET ROLE) while the runtime mutex was usually held. Writes now reuse at most -// database.pool_size connections (ADR-0154). +// database.pool_size connections on PostgreSQL (ADR-0154) and one on SQLite +// (ADR-0834). #include "../support/TempDirectory.hpp" #include "merovingian/database/ExaminedRows.hpp" #include "merovingian/database/PersistentStore.hpp" #include "merovingian/database/PreparedStatement.hpp" #include "merovingian/database/PostgresqlStore.hpp" +#include "merovingian/database/SqliteConnectionDeleter.hpp" +#include "merovingian/database/SqliteWritePool.hpp" #include #include +#include #include #include @@ -22,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +39,28 @@ namespace constexpr auto writers = 64U; constexpr auto limit = std::uint32_t{4U}; +// SQLite's busy handler gives up after 5 s (busy_timeout_ms in SqliteStore.cpp); +// a write held this long would outlast it by 2 s. +constexpr auto longer_than_sqlite_busy_timeout = std::chrono::milliseconds{7000}; + +// A plain read-write connection to the store's file, for a test that holds +// SQLite's write lock itself. Opened by SQLite, as ADR-0157 requires. +[[nodiscard]] auto open_raw_writer(std::filesystem::path const& path) + -> std::optional +{ + auto* raw = static_cast(nullptr); + if (sqlite3_open_v2(path.string().c_str(), &raw, SQLITE_OPEN_READWRITE, nullptr) != SQLITE_OK) + { + sqlite3_close(raw); + return std::nullopt; + } + return merovingian::database::SqliteConnection{raw}; +} + +[[nodiscard]] auto run_sql(merovingian::database::SqliteConnection const& connection, char const* sql) -> bool +{ + return sqlite3_exec(connection.get(), sql, nullptr, nullptr, nullptr) == SQLITE_OK; +} [[nodiscard]] auto insert_room(std::string const& room_id) -> merovingian::database::PreparedStatement { @@ -150,10 +177,12 @@ auto terminate_other_backends(std::string const& uri) -> bool } // namespace -SCENARIO("DB-7 concurrent writes to SQLite reuse at most database.pool_size connections", +// SQLite runs one write at a time, so its writes share one connection whatever +// database.pool_size allows (ADR-0834). +SCENARIO("DB-7 concurrent writes to SQLite share one connection, whatever database.pool_size allows", "[db7][integration][database]") { - GIVEN("a real SQLite store whose write connections are limited to four") + GIVEN("a real SQLite store whose write connections database.pool_size would limit to four") { auto const directory = TemporaryDirectory{}; auto const path = directory.path() / "db7.sqlite3"; @@ -166,10 +195,10 @@ SCENARIO("DB-7 concurrent writes to SQLite reuse at most database.pool_size conn { auto const committed = commit_concurrently(store, "!db7-sqlite-"); - THEN("every write is durable and no more than four connections were ever opened for them") + THEN("every write is durable and one connection was opened for all of them") { CHECK(committed == writers); - CHECK(merovingian::database::write_connections_opened(store) <= limit); + CHECK(merovingian::database::write_connections_opened(store) == 1U); auto const reopened = merovingian::database::open_sqlite_persistent_store(path.string()); REQUIRE(reopened.ok); CHECK(reopened.store.rooms.size() == writers); @@ -178,6 +207,62 @@ SCENARIO("DB-7 concurrent writes to SQLite reuse at most database.pool_size conn } } +// SQLite's lock wait is a busy handler that polls, backing off to every 100 ms, +// and gives up after 5 s. A second write connection of this process waiting for +// the first one's lock polls against it, and is refused if the first holds the +// lock for longer: a single slow write, or one connection committing back to back +// (every journal and database sync runs under EXCLUSIVE), which is how the DB-7 +// scenario above lost three writes under load on 2026-11-17 (ADR-0834). +SCENARIO("A SQLite write waits for another write of this process for longer than SQLite's busy timeout", + "[db7][integration][database]") +{ + GIVEN("a real SQLite store allowed four write connections, one of whose writes holds SQLite's write lock") + { + auto const directory = TemporaryDirectory{}; + auto const path = directory.path() / "db7-held.sqlite3"; + auto opened = merovingian::database::open_sqlite_persistent_store(path.string()); + REQUIRE(opened.ok); + auto& store = opened.store; + merovingian::database::set_write_connection_limit(store, limit); + REQUIRE(store.sqlite_write_pool != nullptr); + // The held write leases a slot of the store's own pool, as a write of the + // store does, but on a connection this test drives. + auto held = store.sqlite_write_pool->pool.acquire( + [&path] { + return open_raw_writer(path); + }, + [](merovingian::database::SqliteConnection const&) { + return true; + }); + REQUIRE(held.has_value()); + held->discard(); + REQUIRE(run_sql(held->get(), "BEGIN IMMEDIATE")); + REQUIRE(run_sql(held->get(), "INSERT INTO rooms (room_id, creator_user_id, directory_public) VALUES " + "('!db7-held:example.org', '@db7:example.org', 'false')")); + + WHEN("a second write starts and the first commits only after SQLite's busy timeout has passed") + { + auto second = std::async(std::launch::async, [&store] { + return merovingian::database::commit_persistent_transaction(store, + {insert_room("!db7-waiting:example.org")}); + }); + std::this_thread::sleep_for(longer_than_sqlite_busy_timeout); + auto const first_committed = run_sql(held->get(), "COMMIT"); + held.reset(); + auto const second_committed = second.get(); + + THEN("the second write waited for the first instead of being refused, and both are durable") + { + CHECK(first_committed); + CHECK(second_committed); + auto const reopened = merovingian::database::open_sqlite_persistent_store(path.string()); + REQUIRE(reopened.ok); + CHECK(reopened.store.rooms.size() == 2U); + } + } + } +} + SCENARIO("DB-7 concurrent writes to PostgreSQL reuse at most database.pool_size connections, and replace dead ones", "[db7][integration][database][postgresql]") { From 9ebdc0d9ea177f8d7e70ee57d1c589873fca54d0 Mon Sep 17 00:00:00 2001 From: James Chapman Date: Wed, 18 Nov 2026 00:55:23 +0000 Subject: [PATCH 2/3] Name the one SQLite write connection in the review skill's database invariants Co-Authored-By: Claude Opus 5.5 --- .../skills/merovingian-review/references/module-invariants.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.agent/skills/merovingian-review/references/module-invariants.md b/.agent/skills/merovingian-review/references/module-invariants.md index 32e82193c..923ed6f25 100644 --- a/.agent/skills/merovingian-review/references/module-invariants.md +++ b/.agent/skills/merovingian-review/references/module-invariants.md @@ -103,6 +103,8 @@ look at every time. Read the `AGENTS.md` itself before judging a change to that tests. `src/database/AGENTS.md#Security rules — non-negotiable` - Every BLOB write sets `BoundValue::binary`. - One transaction is one pooled lease. Never take a second lease while holding one: that deadlocks (ADR-0154). + SQLite has exactly one write connection; a change that lets it open more brings back writes refused after + SQLite's 5 s busy timeout (ADR-0834). - A read that combines several tables into one picture of a room runs in one read transaction (ADR-0161). Federated join writes are single transactions (ADR-0714). - Reads go by index, never scan. `PersistentStore` mutexes follow ADR-0517. A member added to `PersistentStore` From 9b645b3a51350238da311d7efb32435e8e287ccf Mon Sep 17 00:00:00 2001 From: James Chapman Date: Wed, 18 Nov 2026 01:00:41 +0000 Subject: [PATCH 3/3] Change the version only when the owner asks, and keep this branch at 1.1.3 The owner's rule from 2026-11-18: no branch increments the version on its own; it changes only when the owner asks, and every change adds its CHANGELOG bullets to the newest version's entry (ADR-0835, superseding ADR-0464 and the per-branch increment of ADR-0647). docs/versioning.md, the root AGENTS.md, docs/coding-rules.md, docs/AGENTS.md and the review skill now say so. Under the new rule this branch drops its 1.1.4 bump: every version location is back to its base's 1.1.3, and the SQLite fix's bullet and release-notes sentence move into the 1.1.3 entry. Co-Authored-By: Claude Opus 5.5 --- .agent/skills/merovingian-review/SKILL.md | 10 +-- .../references/obligations.md | 14 ++-- AGENTS.md | 4 +- CHANGELOG.md | 28 ++------ docs/AGENTS.md | 4 +- ...y-changes-do-not-require-a-version-bump.md | 6 +- ...rsions-from-1-0-0-are-major-minor-build.md | 3 +- ...ersion-changes-only-when-the-owner-asks.md | 66 +++++++++++++++++++ docs/adr/index.md | 5 +- docs/coding-rules.md | 7 +- docs/versioning.md | 63 ++++++++++-------- meson.build | 2 +- packaging/freebsd/+MANIFEST | 2 +- packaging/netbsd/Makefile | 2 +- packaging/opensuse/merovingian.spec | 5 +- packaging/rhel/merovingian.spec | 5 +- packaging/rpm/merovingian.spec | 5 +- scripts/build-deb.sh | 4 +- scripts/build-freebsd-pkg.sh | 4 +- scripts/build-netbsd-pkg.sh | 4 +- scripts/build-openbsd-pkg.sh | 4 +- scripts/build-opensuse-rpm.sh | 4 +- scripts/build-rhel-rpm.sh | 4 +- scripts/build-rpm.sh | 4 +- scripts/build-static-linux.sh | 2 +- src/db_migrate.cpp | 2 +- src/main.cpp | 2 +- 27 files changed, 159 insertions(+), 106 deletions(-) create mode 100644 docs/adr/0835-the-version-changes-only-when-the-owner-asks.md diff --git a/.agent/skills/merovingian-review/SKILL.md b/.agent/skills/merovingian-review/SKILL.md index 2165f5383..1257f194b 100644 --- a/.agent/skills/merovingian-review/SKILL.md +++ b/.agent/skills/merovingian-review/SKILL.md @@ -1,6 +1,6 @@ --- name: merovingian-review -description: "Review a Merovingian pull request, branch or local diff against this project's binding rules: docs/coding-rules.md, the security coding rules, the per-module AGENTS.md invariants, the Matrix v1.19 spec, and the change obligations (CHANGELOG, docs, ADR, version bump, PR headings). It targets the defect classes this project has actually shipped. Use when asked to review a PR, branch, diff or commit in this repository, to check a change before merge, to verify a subagent's or another session's work, or to post review comments on a Merovingian PR." +description: "Review a Merovingian pull request, branch or local diff against this project's binding rules: docs/coding-rules.md, the security coding rules, the per-module AGENTS.md invariants, the Matrix v1.19 spec, and the change obligations (CHANGELOG, docs, ADR, version and PR headings). It targets the defect classes this project has actually shipped. Use when asked to review a PR, branch, diff or commit in this repository, to check a change before merge, to verify a subagent's or another session's work, or to post review comments on a Merovingian PR." --- # Merovingian review @@ -22,7 +22,7 @@ against this skill. | [references/rule-checks.md](references/rule-checks.md) | Grep-able rule checks and judgement checks from the coding and security rules | | [references/recurring-defects.md](references/recurring-defects.md) | Defect classes this project has shipped and fixed, as questions to ask of a diff | | [references/tests.md](references/tests.md) | Where a test belongs, required structure, what the gates catch and miss, how to run and read tests | -| [references/obligations.md](references/obligations.md) | CHANGELOG, docs, ADR, version bump, PR description: rules and commands | +| [references/obligations.md](references/obligations.md) | CHANGELOG, docs, ADR, version, PR description: rules and commands | ## Modes @@ -192,7 +192,7 @@ under Verification as not reviewed. | Tag | Meaning in this project | Blocks merge | |---|---|---| | **[Blocker]** | Wrong result, auth or signature bypass, a worker-trust violation, data loss, a crash, a deadlock or timeout, an unbounded cost reachable by an unprivileged client or remote, a weakened conformance assertion, a broken build or test | Yes | -| **[Major]** | Real defect on a plausible path; incomplete fix; behaviour without a test that fails if reverted; missing CHANGELOG, docs, ADR or version bump the project rules require | Yes, unless the author shows it is wrong | +| **[Major]** | Real defect on a plausible path; incomplete fix; behaviour without a test that fails if reverted; missing CHANGELOG, docs or ADR the project rules require, or a version change the owner did not ask for | Yes, unless the author shows it is wrong | | **[Minor]** | Correct but fragile, unclear or wasteful; a missing negative-path test on non-security code; doc drift | No | | **[Nit]** | Wording, naming, or style no tool owns | Never; collapse them | @@ -260,10 +260,10 @@ One or two sentences: what the change does, and whether the diff supports what i ## Obligations | Item | State | Evidence | -| CHANGELOG bullet in current version, right section | | | +| CHANGELOG bullet in the newest version's entry, right section | | | | Docs per docs/AGENTS.md table | | | | ADR (needed? numbered above all branches? index line?) | | | -| Version bump (or docs-only exemption) and all places agree | | | +| Version unchanged from the base unless the owner asked (ADR-0835), and all places agree | | | | PR description headings | | | ## Evidence log diff --git a/.agent/skills/merovingian-review/references/obligations.md b/.agent/skills/merovingian-review/references/obligations.md index cb52df884..c66861ec3 100644 --- a/.agent/skills/merovingian-review/references/obligations.md +++ b/.agent/skills/merovingian-review/references/obligations.md @@ -13,24 +13,22 @@ ADR-0000/0001/0543/0740/0741. Only the formats are checked by tooling (`test_cha upgrading. - The bullet says what changed for the operator or client, not how, and ends with its ADR or finding ID. - `CHANGELOG-pre-release.md` is frozen (ADR-0740). Any diff to it is a finding. -- A docs-only branch adds its bullets to the **current** version's entry and does not bump. +- Every branch adds its bullets to the **newest** version's entry; it opens a new entry only when the owner asked + for a new version (ADR-0835). ## Version -- One bump per branch, BUILD + 1, except documentation-only changes (ADR-0464). `AGENTS.md` and coding-guidance - edits count as documentation. Any code, build, packaging or test change means the bump applies. +- The version changes only when the owner asks (ADR-0835). A branch whose version differs from its base's, with no + request from the owner in its PR or linked discussion, is a finding, whatever the branch changes. - Every place agrees with `meson.build`. The list is in `docs/versioning.md`: `src/main.cpp`, `src/db_migrate.cpp`, the FreeBSD manifest, the NetBSD Makefile, three RPM specs (each also with a new dated - `%changelog` entry), the `scripts/build-*.sh` scripts, and the CHANGELOG heading. -- The number must not be taken by another open branch. Check before approving. + `%changelog` entry when the version changes), the `scripts/build-*.sh` scripts, and the CHANGELOG heading. ```bash -git show origin/main:meson.build | grep -m1 "version:"; grep -m1 "version:" meson.build +git show :meson.build | grep -m1 "version:"; grep -m1 "version:" meson.build grep -n 'version = std::string_view' src/main.cpp src/db_migrate.cpp grep -n '^Version:' packaging/{rpm,rhel,opensuse}/merovingian.spec grep -nE '^VERSION=' scripts/build-*.sh -for r in $(git for-each-ref --format='%(refname)' refs/remotes/origin); do - git show "$r:meson.build" 2>/dev/null | grep -m1 -o "version: '[^']*'" | sed "s|^|$r |"; done | sort -k3 | tail ``` ## Docs diff --git a/AGENTS.md b/AGENTS.md index d4aae725e..a553e603b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,7 +27,9 @@ report any unresolved conflict or unmet requirement. See - Flag potential bugs or edge cases after the code explanation if relevant. - With every change, update the relevant docs. See [docs/AGENTS.md](docs/AGENTS.md) for the update table. - Before creating a new branch from main, pull from origin so that main is up to date. -- Bump the version number on creating a new branch, except for documentation-only changes. See versioning doc for all the places where the version number needs updating. +- Never change the version number unless the owner asks for it; a new branch keeps its base's version, and its + CHANGELOG bullets go in the newest version's entry. See the [bump policy](docs/versioning.md#bump-policy) and + [ADR-0835](docs/adr/0835-the-version-changes-only-when-the-owner-asks.md). - Update the docs when code change invalidates something. - Record a decision in the ADR register (`docs/adr/`) whenever you make one. A decision qualifies when a future reader would otherwise be likely to undo it diff --git a/CHANGELOG.md b/CHANGELOG.md index cda174ed3..1cde09836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,27 +3,6 @@ Changes from 1.0.0, the first production release, onwards; the format is set out Changes before 1.0.0 are in [CHANGELOG-pre-release.md](CHANGELOG-pre-release.md), which is no longer added to ([ADR-0740](docs/adr/0740-the-changelog-starts-at-1-0-0-and-the-pre-release-entries-are-a-frozen-record.md)). -# Version 1.1.4 - -## Features - -* None. - -## Security Fixes - -* None. - -## Bug fixes - -* SQLite writes share one connection, whatever `database.pool_size` says: a second write connection waited for the - first's lock by polling, lost to its back-to-back commits and was refused after 5 s, failing the write (ADR-0834). - -## Release notes - -1.1.4 stops a SQLite server from refusing writes under sustained write load. Writes now wait their turn on the one -SQLite write connection instead of racing for SQLite's lock on several and failing after 5 s. `database.pool_size` -now applies to PostgreSQL only. No configuration change is needed. - # Version 1.1.3 ## Features @@ -34,6 +13,8 @@ now applies to PostgreSQL only. No configuration change is needed. tokens for this server's SFU, judged by the main process and refused to a server the room's ACL denies (ADR-0831). * `delegate_delayed_leave` (MSC4195): this server sends a caller's delayed leave once LiveKit no longer shows them, checked every 30 s and sooner on LiveKit's signed webhook, kept across restarts (ADR-0832, ADR-0833). +* A branch no longer bumps the version: it changes only when the owner asks, and a change adds its bullets to the + newest version's entry here (ADR-0835). ## Security Fixes @@ -49,12 +30,15 @@ now applies to PostgreSQL only. No configuration change is needed. * `use_state_after`: a room forked at `since` now gets exactly what changed since what the client was told, read from an in-memory log of state changes, and so does a left room (ADR-0827). +* SQLite writes share one connection, whatever `database.pool_size` says: a second write connection waited for the + first's lock by polling, lost to its back-to-back commits and was refused after 5 s, failing the write (ADR-0834). ## Release notes Version 1.1.3 is in progress: a LiveKit token service built into the server for MatrixRTC calls, with delegated leaves, and an exact `state_after` on `/sync`. It adds migration 004 (`livekit_delegations`). After a restart, the first -`state_after` sync of each room with news carries its whole state once. +`state_after` sync of each room with news carries its whole state once. A SQLite server no longer refuses writes under +sustained write load, and `database.pool_size` now applies to PostgreSQL only. # Version 1.1.2 diff --git a/docs/AGENTS.md b/docs/AGENTS.md index dc1bb6946..caf3f462c 100644 --- a/docs/AGENTS.md +++ b/docs/AGENTS.md @@ -8,7 +8,7 @@ new documents. | Document | What to add/update | |---|---| -| `../CHANGELOG.md` (repo root) | Describe what changed. Add a new `# Version X.Y.Z` entry when the version changes, with exactly the headings `## Features`, `## Security Fixes`, `## Bug fixes` and `## Release notes`: bullets of two lines at most, and one short release-notes paragraph ([changelog format](versioning.md#changelog-format), [ADR-0741](adr/0741-each-changelog-version-has-features-security-fixes-bug-fixes-and-release-notes.md)). Documentation-only changes add bullets to the current version's entry without a bump. Never add to `../CHANGELOG-pre-release.md`, the frozen record of the 0.x series ([ADR-0740](adr/0740-the-changelog-starts-at-1-0-0-and-the-pre-release-entries-are-a-frozen-record.md)). | +| `../CHANGELOG.md` (repo root) | Describe what changed. Add a new `# Version X.Y.Z` entry only when the owner asks for a new version, with exactly the headings `## Features`, `## Security Fixes`, `## Bug fixes` and `## Release notes`: bullets of two lines at most, and one short release-notes paragraph ([changelog format](versioning.md#changelog-format), [ADR-0741](adr/0741-each-changelog-version-has-features-security-fixes-bug-fixes-and-release-notes.md)). Every other change, documentation-only or not, adds bullets to the newest version's entry and never changes the version ([ADR-0835](adr/0835-the-version-changes-only-when-the-owner-asks.md)). Never add to `../CHANGELOG-pre-release.md`, the frozen record of the 0.x series ([ADR-0740](adr/0740-the-changelog-starts-at-1-0-0-and-the-pre-release-entries-are-a-frozen-record.md)). | ## Update when the matching domain changes @@ -17,7 +17,7 @@ new documents. | `coding-rules.md` | A project-wide coding rule is added, changed, or removed. Maintain the rule here; the root `AGENTS.md` requires this document rather than copying its rules. | | `security-coding-rules.md` | A security-relevant rule is added, changed, or removed in any module `AGENTS.md` file | | `testing-standards.md` | A new testing convention is adopted | -| `versioning.md` | Version scheme changes; see also the version bump table | +| `versioning.md` | Version scheme or bump policy changes; see also its table of version locations | | `auth-identity.md` | Auth, session token, or identity changes | | `crypto-boundary.md` | Crypto interface, key management, or signing changes | | `database-persistence.md` | Schema changes (migrations), store interface changes | diff --git a/docs/adr/0464-documentation-only-changes-do-not-require-a-version-bump.md b/docs/adr/0464-documentation-only-changes-do-not-require-a-version-bump.md index 1f4401053..e5f3ce37b 100644 --- a/docs/adr/0464-documentation-only-changes-do-not-require-a-version-bump.md +++ b/docs/adr/0464-documentation-only-changes-do-not-require-a-version-bump.md @@ -1,6 +1,6 @@ # Documentation-only changes do not require a version bump -* Status: accepted +* Status: superseded by [ADR-0835](0835-the-version-changes-only-when-the-owner-asks.md) * Date: 2026-11-05 ## Context and Problem Statement @@ -32,3 +32,7 @@ The maintained policy is in [versioning](../versioning.md#bump-policy). ### Negative Consequences * Authors must check whether later changes make a branch more than documentation-only. + +## Links + +* Superseded by [ADR-0835](0835-the-version-changes-only-when-the-owner-asks.md) diff --git a/docs/adr/0647-versions-from-1-0-0-are-major-minor-build.md b/docs/adr/0647-versions-from-1-0-0-are-major-minor-build.md index 370816fd5..b1b0d6dea 100644 --- a/docs/adr/0647-versions-from-1-0-0-are-major-minor-build.md +++ b/docs/adr/0647-versions-from-1-0-0-are-major-minor-build.md @@ -1,6 +1,6 @@ # Versions from 1.0.0 are MAJOR.MINOR.BUILD -* Status: accepted +* Status: accepted; its per-branch `BUILD` increment is superseded by [ADR-0835](0835-the-version-changes-only-when-the-owner-asks.md) * Date: 2026-11-11 ## Context and Problem Statement @@ -43,4 +43,5 @@ Chosen option: "`MAJOR.MINOR.BUILD`". ## Links * Supersedes [ADR-0047](0047-keep-project-phase-out-of-the-version-string.md) +* Partly superseded by [ADR-0835](0835-the-version-changes-only-when-the-owner-asks.md): the per-branch `BUILD` increment * [docs/versioning.md](../versioning.md) diff --git a/docs/adr/0835-the-version-changes-only-when-the-owner-asks.md b/docs/adr/0835-the-version-changes-only-when-the-owner-asks.md new file mode 100644 index 000000000..77f5f8c78 --- /dev/null +++ b/docs/adr/0835-the-version-changes-only-when-the-owner-asks.md @@ -0,0 +1,66 @@ +# The version changes only when the owner asks + +* Status: accepted +* Date: 2026-11-18 + +Technical Story: the project owner's instruction of 2026-11-18, while a SQLite fix was being stacked on four open +pull requests (1.1.0 to 1.1.3): "No more auto incrementing versions. We'll only do that when I ask for it." + +## Context and Problem Statement + +Every branch with a code, build, packaging or test change incremented `BUILD` when it was created +([ADR-0647](0647-versions-from-1-0-0-are-major-minor-build.md)); documentation-only branches did not +([ADR-0464](0464-documentation-only-changes-do-not-require-a-version-bump.md)). With several branches open at once, +each took the next free number, and every rebase of a stacked branch conflicted in the sixteen places that hold the +version and in the CHANGELOG, whose entries git interleaved. The numbers then said how many branches had been made, +not what a release contains. When does the version change? + +## Considered Options + +* **Only when the owner asks; every change adds its CHANGELOG bullets to the newest version's entry (chosen).** +* Keep one `BUILD` increment per branch. +* Increment once per merge to `main` instead of per branch. + +## Decision Outcome + +Chosen option: the owner decides, because the owner asked for it, and a version is then a release decision rather than +a by-product of branching. + +* No branch changes the version on its own, whatever it changes. A branch keeps the version of the branch it is based + on, in every location `docs/versioning.md` lists. +* Every change, documentation-only or not, adds its bullets to the newest `# Version` entry of `CHANGELOG.md` under the + existing headings, and updates that entry's release-notes paragraph when an operator needs to know about it. The + format rules ([ADR-0741](0741-each-changelog-version-has-features-security-fixes-bug-fixes-and-release-notes.md)) and + the check that the newest entry is the version `meson.build` declares are unchanged. +* When the owner asks for a version, that change sets the version the owner names in every location together, adds its + `%changelog` entries to the three RPM specs, and opens a new CHANGELOG entry above the previous one. +* This supersedes ADR-0464, whose exemption no longer has a rule to except, and the per-branch increment of ADR-0647. + ADR-0647's scheme stands: versions are `MAJOR.MINOR.BUILD`, and `MINOR` and `MAJOR` change when the owner decides. + +### Positive Consequences + +* Parallel and stacked branches no longer conflict over the version, and the CHANGELOG has one entry to add to. + +### Negative Consequences + +* Two builds from different commits can report the same version until the owner asks for a new one. The commit, not + the version string, identifies an unreleased build. + +## Pros and Cons of the Options + +### One increment per branch + +* Good, because every branch's build reports a different version. +* Bad, because of the conflicts and meaningless numbers above, and because the owner no longer wants it. + +### One increment per merge to main + +* Good, because only merged work moves the number. +* Bad, because a merge still picks a number nobody chose for a release, and someone has to make the change at merge + time, which the project has no step for. + +## Links + +* Supersedes [ADR-0464](0464-documentation-only-changes-do-not-require-a-version-bump.md) +* Partly supersedes [ADR-0647](0647-versions-from-1-0-0-are-major-minor-build.md): the per-branch `BUILD` increment +* [docs/versioning.md](../versioning.md) diff --git a/docs/adr/index.md b/docs/adr/index.md index 15221e55c..a1c0a73e0 100644 --- a/docs/adr/index.md +++ b/docs/adr/index.md @@ -457,7 +457,7 @@ * [0510 - The test binaries hash passwords at minimum cost](0510-the-test-binaries-hash-passwords-at-minimum-cost.md) * [0462 - Use std::invoke for callable dispatch and immediate lambdas](0462-use-std-invoke-for-callable-dispatch-and-immediate-lambdas.md) * [0463 - Confine unavoidable C API pointers to RAII wrappers](0463-confine-unavoidable-c-api-pointers-to-raii-wrappers.md) -* [0464 - Documentation-only changes do not require a version bump](0464-documentation-only-changes-do-not-require-a-version-bump.md) +* [0464 - Documentation-only changes do not require a version bump](0464-documentation-only-changes-do-not-require-a-version-bump.md) — Superseded by ADR-0835: no branch bumps the version, so there is nothing to exempt * [0465 - Root agent guidance requires the coding rules without copying them](0465-root-agent-guidance-requires-the-coding-rules-without-copying-them.md) * [0466 - Define one class or struct per file](0466-define-one-class-or-struct-per-file.md) * [0467 - Type filenames match the type name exactly](0467-type-filenames-match-the-type-name-exactly.md) @@ -559,7 +559,7 @@ * [0634 - A share of the push delivery budget is kept for gateways that answer, and one host carries an eighth of it](0634-a-share-of-the-push-delivery-budget-is-kept-for-gateways-that-answer-and-a-host-carries-an-eighth.md) * [0635 - An inbound federation origin is asked about once at a time, and its decision is kept for a short time](0635-an-inbound-federation-origin-is-asked-about-once-at-a-time-and-its-decision-is-kept-for-a-short-time.md) * [0636 - A blob row is deleted with its last reference, and a removed record holds no reference](0636-a-blob-row-is-deleted-with-its-last-reference-and-a-removed-record-holds-none.md) -* [0647 - Versions from 1.0.0 are MAJOR.MINOR.BUILD](0647-versions-from-1-0-0-are-major-minor-build.md) +* [0647 - Versions from 1.0.0 are MAJOR.MINOR.BUILD](0647-versions-from-1-0-0-are-major-minor-build.md) — Partly superseded by ADR-0835: the version changes only when the owner asks, not once per branch * [0648 - The Complement blocker is waived for 1.0.0 only](0648-the-complement-blocker-is-waived-for-1-0-0-only.md) — Extended by ADR-0744: 1.0.1 is waived too * [0731 - A spawned worker gets no terminal, and no sandbox profile allows TIOCSTI or TIOCLINUX](0731-a-spawned-worker-gets-no-terminal-and-no-sandbox-profile-allows-tiocsti.md) * [0732 - Every published attestation check pins the signing workflow and the ref](0732-every-published-attestation-check-pins-the-signing-workflow-and-the-ref.md) — Partly superseded by ADR-0742: every published file is attested by packages.yml @@ -713,3 +713,4 @@ * [0832 - A delegated delayed leave is restarted while LiveKit shows the participant, and sent once it does not](0832-a-delegated-delayed-leave-is-restarted-while-livekit-shows-the-participant-and-sent-once-it-does-not.md) * [0833 - The LiveKit webhook is served on the client listener and trusted only to prompt a check](0833-the-livekit-webhook-is-served-on-the-client-listener-and-trusted-only-to-prompt-a-check.md) * [0834 - SQLite writes share one pooled connection, whatever database.pool_size says](0834-sqlite-writes-share-one-pooled-connection.md) +* [0835 - The version changes only when the owner asks](0835-the-version-changes-only-when-the-owner-asks.md) diff --git a/docs/coding-rules.md b/docs/coding-rules.md index e3f442e90..425e68f8c 100644 --- a/docs/coding-rules.md +++ b/docs/coding-rules.md @@ -239,9 +239,10 @@ defects on executed paths; a clean run does not prove that all paths are safe. bug fix, or experiment. Never make development changes on `main`. Follow the branch prefix required by the project or tool instructions, and submit changes through a pull request. -- Documentation-only changes do not require a version bump. For other changes, - increment the version once when creating the branch. Update all locations in - [versioning](versioning.md) together. +- Do not change the version unless the owner asks for it; a branch keeps the + version of its base. When the owner asks, update all locations in + [versioning](versioning.md) together. See + [ADR-0835](adr/0835-the-version-changes-only-when-the-owner-asks.md). - Update `CHANGELOG.md` for every change, in the [changelog format](versioning.md#changelog-format). Use the [documentation update table](AGENTS.md) to find the other required updates. diff --git a/docs/versioning.md b/docs/versioning.md index d1627a937..9ce94d12c 100644 --- a/docs/versioning.md +++ b/docs/versioning.md @@ -5,13 +5,10 @@ From 1.0.0 Merovingian uses **`MAJOR.MINOR.BUILD`** ([ADR-0647](adr/0647-versions-from-1-0-0-are-major-minor-build.md)). -`BUILD` is the working counter: feature, fix, and packaging branches increment -it by one, exactly as `PATCH` did before 1.0.0. The bump policy below is -unchanged. Documentation-only changes do not require a version bump -([ADR-0464](adr/0464-documentation-only-changes-do-not-require-a-version-bump.md)). - -`MINOR` and `MAJOR` change only when the owner decides. The decision states the -version that follows. +No part of the version changes on its own: `BUILD`, `MINOR` and `MAJOR` all +change only when the owner asks, and the request states the version that follows +([ADR-0835](adr/0835-the-version-changes-only-when-the-owner-asks.md)). See the +bump policy below. **Project phase is declared in `README.md` and `CHANGELOG.md`, never encoded in the version number** ([ADR-0647](adr/0647-versions-from-1-0-0-are-major-minor-build.md), which restates the rule @@ -28,26 +25,34 @@ long, and a new series did not restart at `.0` (`0.9.25` to `0.10.1`, `0.10.63` to `0.11.4`). `1.0.0` was cut when the project reached production. Beta was declared at `v0.10.59`. These rules no longer apply. -## Bump policy +From 1.0.0 until 2026-11-18, every branch with a code, build, packaging or test +change incremented `BUILD` once when it was created, and documentation-only +branches did not ([ADR-0647](adr/0647-versions-from-1-0-0-are-major-minor-build.md), +[ADR-0464](adr/0464-documentation-only-changes-do-not-require-a-version-bump.md)). +That is why 1.0.x and 1.1.x moved one number per branch. It no longer applies. -**One bump per branch, when the branch is created, except for documentation-only changes.** Update `CHANGELOG.md` -and every version location below together before the branch's first commit. -Do not increment again on intermediate commits. Before raising the PR, verify -that the version remains consistent with the base branch; if another branch -has used that version in the meantime, update all locations together to the -next available build number. There is no separate merge-time bump. +## Bump policy -The one exception is the `release.yml` fix that let 1.0.0 publish: the owner -kept it at 1.0.0 and moved the unpublished `v1.0.0` tag to it +**The version changes only when the owner asks for it** +([ADR-0835](adr/0835-the-version-changes-only-when-the-owner-asks.md)). No branch +changes it on its own, whatever the branch changes: code, build, packaging, +tests or documentation. A branch keeps the version of the branch it is based on, +in every location below. + +Every change adds its notes as bullets to the newest `# Version` entry of +`CHANGELOG.md`, in the [changelog format](#changelog-format): new behaviour or +guidance under `Features`, a vulnerability under `Security Fixes`, any other +correction under `Bug fixes`. Update that entry's release-notes paragraph when an +operator needs to know about the change. + +When the owner asks for a version, that change sets the version the owner names +in every location below in one commit, adds the dated `%changelog` entry to each +RPM spec, and opens a new `# Version` entry at the top of `CHANGELOG.md` for the +changes that follow. + +The `release.yml` fix that let 1.0.0 publish kept 1.0.0 and moved the +unpublished `v1.0.0` tag to it ([ADR-0651](adr/0651-the-v1-0-0-tag-moves-to-the-release-workflow-fix-without-a-version-bump.md)). -It is not a precedent. - -For a documentation-only branch, keep the current version and add the change -notes as bullets in its `CHANGELOG.md` entry: new guidance under `Features`, a -correction under `Bug fixes`. Changes to coding -guidance and `AGENTS.md` files are documentation changes. If the branch later -includes code, build, or packaging changes, apply the bump policy before -committing those changes. ## Changelog format @@ -136,19 +141,19 @@ than the others. a new dated entry for every version — the `Version:` field alone is not sufficient for `rpmbuild` to accept the spec. - Historical version strings in `CHANGELOG.md`, `CHANGELOG-pre-release.md` and every spec - `%changelog` are records, not live values; do not edit them when bumping. + `%changelog` are records, not live values; do not edit them when the version changes. - `CHANGELOG.md` starts at 1.0.0. The 0.x entries are in `CHANGELOG-pre-release.md`, a frozen record that nothing is added to ([ADR-0740](adr/0740-the-changelog-starts-at-1-0-0-and-the-pre-release-entries-are-a-frozen-record.md)). - `tests/tooling/test_packages_workflow.py` enforces that every file in the table above carries the current `meson.build` version. Run it (or `python build.py - vm`) after a bump to catch any location that was missed. + vm`) after a version change to catch any location that was missed. ## Release process 1. Update `main` from `origin`, then create a feature or fix branch from it. -2. Unless the changes are documentation-only, increment the build number in every location above and add its changelog section. -3. Make the changes and keep that version for intermediate commits. -4. Before raising the PR, check version consistency and conflicts with the base branch. +2. Make the changes without touching the version, and add their bullets to the newest `CHANGELOG.md` entry. +3. Only when the owner asks for a version: set it in every location above and open its changelog entry. +4. Before raising the PR, check that the version and the CHANGELOG agree with the base branch and do not conflict. 5. Raise a PR. CI builds the configured platform artifacts and runs the test suite; see [platform-support.md](platform-support.md) for the artifact matrix. 6. Merge to `main`. The `publish-latest` CI job replaces the rolling GitHub diff --git a/meson.build b/meson.build index 2cce404da..887a3f69f 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'merovingian', 'cpp', 'c', - version: '1.1.4', + version: '1.1.3', license: 'GPL-3.0-or-later', meson_version: '>=1.1.0', default_options: [ diff --git a/packaging/freebsd/+MANIFEST b/packaging/freebsd/+MANIFEST index 68e179096..77d305136 100644 --- a/packaging/freebsd/+MANIFEST +++ b/packaging/freebsd/+MANIFEST @@ -1,5 +1,5 @@ name: "merovingian" -version: "1.1.4" +version: "1.1.3" origin: net/merovingian comment: Secure Matrix Protocol homeserver desc: "Merovingian is a Matrix Protocol homeserver." diff --git a/packaging/netbsd/Makefile b/packaging/netbsd/Makefile index ae9ba93a1..172afbb90 100644 --- a/packaging/netbsd/Makefile +++ b/packaging/netbsd/Makefile @@ -1,4 +1,4 @@ -DISTNAME= merovingian-1.1.4 +DISTNAME= merovingian-1.1.3 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_GITHUB:=OMG-Software/} GITHUB_PROJECT= Merovingian diff --git a/packaging/opensuse/merovingian.spec b/packaging/opensuse/merovingian.spec index 9033a7f3a..ad696ac3b 100644 --- a/packaging/opensuse/merovingian.spec +++ b/packaging/opensuse/merovingian.spec @@ -1,5 +1,5 @@ Name: merovingian -Version: 1.1.4 +Version: 1.1.3 Release: 1%{?dist} Summary: Secure Matrix Protocol homeserver @@ -115,9 +115,6 @@ fi %{_sysconfdir}/merovingian/merovingian.conf.example %changelog -* Wed Nov 18 2026 James Chapman - 1.1.4-1 -- Merovingian 1.1.4 - * Tue Nov 17 2026 James Chapman - 1.1.3-1 - Merovingian 1.1.3 diff --git a/packaging/rhel/merovingian.spec b/packaging/rhel/merovingian.spec index 55b38e1c3..c1833789f 100644 --- a/packaging/rhel/merovingian.spec +++ b/packaging/rhel/merovingian.spec @@ -1,5 +1,5 @@ Name: merovingian -Version: 1.1.4 +Version: 1.1.3 Release: 1%{?dist} Summary: Secure Matrix Protocol homeserver @@ -100,9 +100,6 @@ fi %{_sysconfdir}/merovingian/merovingian.conf.example %changelog -* Wed Nov 18 2026 James Chapman - 1.1.4-1 -- Merovingian 1.1.4 - * Tue Nov 17 2026 James Chapman - 1.1.3-1 - Merovingian 1.1.3 diff --git a/packaging/rpm/merovingian.spec b/packaging/rpm/merovingian.spec index ee2ab3e7f..2291e8410 100644 --- a/packaging/rpm/merovingian.spec +++ b/packaging/rpm/merovingian.spec @@ -1,5 +1,5 @@ Name: merovingian -Version: 1.1.4 +Version: 1.1.3 Release: 1%{?dist} Summary: Secure Matrix Protocol homeserver @@ -104,9 +104,6 @@ fi %{_sysconfdir}/merovingian/merovingian.conf.example %changelog -* Wed Nov 18 2026 James Chapman - 1.1.4-1 -- Merovingian 1.1.4 - * Tue Nov 17 2026 James Chapman - 1.1.3-1 - Merovingian 1.1.3 diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh index 4139b9f5d..40460537a 100755 --- a/scripts/build-deb.sh +++ b/scripts/build-deb.sh @@ -1,9 +1,9 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build for merovingian 1.1.4. +# Build for merovingian 1.1.3. set -e -VERSION="1.1.4" +VERSION="1.1.3" PKG_NAME="merovingian" STAGING="staging-deb" diff --git a/scripts/build-freebsd-pkg.sh b/scripts/build-freebsd-pkg.sh index 15db5aac7..67bb69112 100755 --- a/scripts/build-freebsd-pkg.sh +++ b/scripts/build-freebsd-pkg.sh @@ -1,9 +1,9 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build for merovingian 1.1.4. +# Build for merovingian 1.1.3. set -e -VERSION="1.1.4" +VERSION="1.1.3" STAGING="staging-fbsd" # Clean any state (staged files, build dir) from cached FreeBSD VM runs. diff --git a/scripts/build-netbsd-pkg.sh b/scripts/build-netbsd-pkg.sh index dc3c13451..5022a7975 100644 --- a/scripts/build-netbsd-pkg.sh +++ b/scripts/build-netbsd-pkg.sh @@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build for merovingian 1.1.4. +# Build for merovingian 1.1.3. # # The checked-in packaging/netbsd/Makefile is the pkgsrc recipe kept for # downstream porters. This script generates a framework-free package so CI @@ -11,7 +11,7 @@ # a staged tree using tar, which produces a package that pkg_add can install. set -e -VERSION="1.1.4" +VERSION="1.1.3" STAGE="staging-netbsd" PREFIX=/usr/pkg diff --git a/scripts/build-openbsd-pkg.sh b/scripts/build-openbsd-pkg.sh index 08c14d560..f0b043f10 100644 --- a/scripts/build-openbsd-pkg.sh +++ b/scripts/build-openbsd-pkg.sh @@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build for merovingian 1.1.4. +# Build for merovingian 1.1.3. # # Standalone pkg_create(1), no ports tree. The checked-in packaging/openbsd/PLIST # is the ports-framework packing list kept for downstream porters; this script @@ -8,7 +8,7 @@ # produce and validate an installable package on every run. set -e -VERSION="1.1.4" +VERSION="1.1.3" STAGE="staging-openbsd" PREFIX=/usr/local diff --git a/scripts/build-opensuse-rpm.sh b/scripts/build-opensuse-rpm.sh index 0391a7dbf..e2e5e79cb 100644 --- a/scripts/build-opensuse-rpm.sh +++ b/scripts/build-opensuse-rpm.sh @@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build an RPM package for merovingian 1.1.4 on OpenSUSE Tumbleweed or Leap. +# Build an RPM package for merovingian 1.1.3 on OpenSUSE Tumbleweed or Leap. # # Uses packaging/opensuse/merovingian.spec which adapts BuildRequires to # OpenSUSE package names (libopenssl-devel, postgresql-devel, libpng16-devel, @@ -12,7 +12,7 @@ # (.leap16, ADR-0650). set -e -VERSION="1.1.4" +VERSION="1.1.3" DIST="${MEROVINGIAN_RPM_DIST:-.tumbleweed}" case "${DIST}" in .[a-z]*) ;; diff --git a/scripts/build-rhel-rpm.sh b/scripts/build-rhel-rpm.sh index 3b8881761..ab43f76bb 100644 --- a/scripts/build-rhel-rpm.sh +++ b/scripts/build-rhel-rpm.sh @@ -1,13 +1,13 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build an RPM package for merovingian 1.1.4 targeting RHEL 10 / AlmaLinux 10. +# Build an RPM package for merovingian 1.1.3 targeting RHEL 10 / AlmaLinux 10. # # Differs from build-rpm.sh only in the spec file used: packaging/rhel/merovingian.spec # omits catch-devel from BuildRequires (Catch2 is not reliably available in EPEL 10 # and is not needed when -Dbuild_tests=false). set -e -VERSION="1.1.4" +VERSION="1.1.3" mkdir -p "${HOME}/rpmbuild/BUILD" mkdir -p "${HOME}/rpmbuild/BUILDROOT" diff --git a/scripts/build-rpm.sh b/scripts/build-rpm.sh index b767048dd..91a7ebacf 100755 --- a/scripts/build-rpm.sh +++ b/scripts/build-rpm.sh @@ -1,9 +1,9 @@ #!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later -# Build an RPM package for merovingian 1.1.4 using rpmbuild. +# Build an RPM package for merovingian 1.1.3 using rpmbuild. set -e -VERSION="1.1.4" +VERSION="1.1.3" # 1. Create rpmbuild directory tree mkdir -p "${HOME}/rpmbuild/BUILD" diff --git a/scripts/build-static-linux.sh b/scripts/build-static-linux.sh index 76e629513..455810c6a 100755 --- a/scripts/build-static-linux.sh +++ b/scripts/build-static-linux.sh @@ -3,7 +3,7 @@ # Build a portable Linux fallback tarball with musl-linked static PIE binaries. set -eu -VERSION="${MEROVINGIAN_VERSION:-1.1.4}" +VERSION="${MEROVINGIAN_VERSION:-1.1.3}" BUILD_DIR="${BUILD_DIR:-build-static-linux}" STAGING="staging-static-linux" PACKAGE_ROOT="merovingian-${VERSION}-linux-static-x86_64" diff --git a/src/db_migrate.cpp b/src/db_migrate.cpp index 01099f901..8ed212e6a 100644 --- a/src/db_migrate.cpp +++ b/src/db_migrate.cpp @@ -23,7 +23,7 @@ namespace { -constexpr auto version = std::string_view{"1.1.4"}; +constexpr auto version = std::string_view{"1.1.3"}; auto print_help() -> void { diff --git a/src/main.cpp b/src/main.cpp index 6d4dd3fd9..cd01db309 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -83,7 +83,7 @@ namespace { -constexpr auto version = std::string_view{"1.1.4"}; +constexpr auto version = std::string_view{"1.1.3"}; struct BootstrapConfigResult final {