3 Commits
Author SHA1 Message Date
Andras Bacsai 658ac6bca5 fix(database): check MongoDB health with ping
The MongoDB health check passed only on the writable primary
(db.hello().isWritablePrimary or isMaster().ismaster). A replica set
that was never initiated, which is common for Prisma setups, and any
non-primary member were reported unhealthy after a restart.

The check now runs db.adminCommand({ ping: 1 }) with mongosh or the
legacy mongo shell. Ping needs no authentication, passes on every
running member, and still fails when mongod is not reachable.
2026-10-01 07:16:27 +02:00
Andras Bacsai b13fa4dad0 fix(database): choose the MongoDB health check shell at run time
The health check from #11730 picked mongosh or the legacy mongo shell
from the image name (mongo:4*). Images without mongosh whose name does
not start with mongo:4, such as mongo:3.6 or registry mirrors of
mongo:4.4, ran a missing mongosh (exit 127) and stayed unhealthy.

The check now uses mongosh when the container has it and falls back
to the legacy mongo shell otherwise.

Replace the test that only checked the source text with tests that run
the generated script with fake shells.
2026-09-30 20:48:54 +02:00
Christoph Bratschi cf4c6600df fix(database): use MongoDB writable-primary health check 2026-09-10 23:15:39 +02:00