Răsfoiți Sursa

docs: the database packages are held, so an upgrade needs the flag

A --dry-run a few hours before the window caught what would have broken it:
smartbotic-database and libsmartbotic-db-client are on apt hold, so the
pinned install fails outright with "Held packages were changed and -y was
used without --allow-change-held-packages".

Prefer the flag over unhold-plus-rehold. The hold is per package rather than
per version, so it survives the upgrade and keeps protecting the new version;
the unhold route leaves the database freely upgradable if the re-hold is ever
forgotten, and a protection silently switched off is worse than an install
that refuses.

The signal was in plain sight. dpkg -l prints hi rather than ii for a held
package, and that was in the first prod inventory I took this morning - I
read the versions out of it and ignored the status column. The lesson is the
cheaper half of the day's theme: I was reading the number I came for and not
the line it sat on.

The dry run also confirmed what the install will actually do: 2 upgraded, 1
newly installed (smartbotic-db-cli, which is how encryption-verify reaches
prod), 0 removed, nothing held back, no dependency surprises.
fszontagh 1 lună în urmă
părinte
comite
369ff874af
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      CLAUDE.md

+ 2 - 0
CLAUDE.md

@@ -178,6 +178,8 @@ docker run -d --name svapi-dev -p 8080:8080 -e SMARTBOTIC_VECTORAPI_KEY=dev svap
   Note the upstream log line still says "old plaintext copies are removed at the next restart" even when it rewrote NOTHING, which contradicts verify's `sealed: yes` and would have an operator restart for no reason. Trust verify.
 - **MOVING THE CLIENT PACKAGE UNDER AN EXISTING BINARY IS AN ABI QUESTION, AND IT IS CHEAP TO TEST.** Every 2.x client shares one SONAME, so apt will happily put a 2.17.2 `libsmartbotic-db-client.so.2` under a server binary compiled against 2.14.0 headers - and the documented failure mode is that it installs fine and segfaults later. Verified before deploying rather than hoped: a Debian 13 container holding the real `smartbotic-vectorapi 0.12.0-1` deb plus `libsmartbotic-db-client 2.17.2-1`, against a 2.17.2 server, answered **21 of 21 calls** correctly - including `POST /indexes` with `unique`, which exercises `CreateIndexResult`, the by-value struct whose SIZE is the thing that would break, and a 409 duplicate refusal, which proves `duplicateExamples` crossed the boundary intact. `/api/v1/version` reported `db_client: 2.17.2` so the new library really was loaded. Repeat this whenever `DB_CLIENT_VERSION` and the deployed client diverge; it takes minutes and the alternative is a restart days later.
 - **Prod's database binds `localhost`, not `0.0.0.0`** (`storage.bind_address`), which is why it is only reachable from vectorapi on the same box - correct, and worth knowing before wondering why a port-mapped copy refuses connections.
+- **THE DATABASE PACKAGES ARE ON APT HOLD, so an upgrade needs `--allow-change-held-packages` or it FAILS.** `apt-mark showhold` lists `smartbotic-database` and `libsmartbotic-db-client`; our three app packages are not held, which is why an ordinary vectorapi release needs nothing special. A pinned install without the flag dies with `E: Held packages were changed and -y was used without --allow-change-held-packages` - caught here by a `--dry-run` a few hours before a window, which is the only reason it was not discovered mid-outage. **Prefer the FLAG over `apt-mark unhold` plus a re-hold:** the hold is per PACKAGE rather than per version, so it survives the upgrade and keeps protecting the new version automatically, whereas the unhold route leaves the database freely upgradable if the re-hold is ever forgotten - a protection silently switched off is worse than an install that refuses.
+  **The signal was in plain sight and I walked past it.** `dpkg -l` prints `hi` rather than `ii` for a held package, and that appeared in the very first prod inventory of the day; I read the versions out of that output and ignored the status column. Always `--dry-run` a pinned install before a window and read what it says it will do: this one also confirmed 2 upgraded, 1 newly installed (`smartbotic-db-cli`, which is how `encryption-verify` arrives on prod), 0 removed and nothing held back.
 - **Abseil ABI:** `smartbotic-database`/client debs must be built against the system's current Abseil; a stale build crash-loops on `libabsl_*.so.<old>`. Rebuild the DB if it won't start.
 - **`--rebuild-base` is required when `DB_CLIENT_VERSION` moves.** The client version is baked into the Docker BASE image, so bumping the variable alone leaves the release build compiling against the old headers - it fails on the new entry points, or worse, silently links the old ones. Note `devstack/run-tests.sh` installs the client debs explicitly, so the TEST path can be on a newer client than the RELEASE path: a green suite is not evidence about the packages.
 - **`systemctl start` on an already-running unit is a no-op.** A package postinst starts the service, so any config written AFTER apt needs a `restart`, not a `start` - otherwise the process keeps the config that existed at install time and the file on disk disagrees with the running state. Compare the file mtime against `systemctl show -p ActiveEnterTimestamp` when a setting appears not to apply.