feat: use postgres
This commit is contained in:
+33
-7
@@ -32,20 +32,46 @@ additional process-level operational endpoint.
|
||||
|
||||
## Common Failure Modes
|
||||
|
||||
### PostgreSQL unavailable
|
||||
|
||||
Symptoms:
|
||||
|
||||
- process fails during startup with `ping postgres` or `run postgres
|
||||
migrations` in the error chain
|
||||
- readiness probe never reports healthy, internal API never opens
|
||||
- internal API returns `503 service_unavailable` if connectivity is lost
|
||||
after start
|
||||
|
||||
Checks:
|
||||
|
||||
- DSN reachable from the service host: `psql "$USERSERVICE_POSTGRES_PRIMARY_DSN" -c "select 1"`
|
||||
- `userservice` role exists with `LOGIN` and the configured password
|
||||
- Schema `user` exists and is owned (or grant-accessible) by the
|
||||
`userservice` role: `\dn user`
|
||||
- Embedded migrations applied: query `goose_db_version` (the schema-qualified
|
||||
goose bookkeeping table) and confirm the latest version matches the
|
||||
binary's expectation
|
||||
- Pool tuning sane:
|
||||
`USERSERVICE_POSTGRES_MAX_OPEN_CONNS` ≥ peak request fan-out
|
||||
|
||||
### Redis unavailable
|
||||
|
||||
Symptoms:
|
||||
|
||||
- process fails during startup
|
||||
- internal API returns `503 service_unavailable`
|
||||
- domain events stop being published
|
||||
- process fails during startup with `ping redis master` in the error chain
|
||||
- domain events / lifecycle events stop being published
|
||||
- internal API still serves reads/writes (PostgreSQL is the source of truth);
|
||||
publishers degrade gracefully but operators must investigate
|
||||
|
||||
Checks:
|
||||
|
||||
- connectivity to `USERSERVICE_REDIS_ADDR`
|
||||
- Redis ACL credentials
|
||||
- Redis DB number
|
||||
- TLS setting mismatch
|
||||
- connectivity to `USERSERVICE_REDIS_MASTER_ADDR`
|
||||
- `USERSERVICE_REDIS_PASSWORD` matches the Redis configuration
|
||||
- Redis DB number is reachable and unblocked
|
||||
- The retired variables `USERSERVICE_REDIS_ADDR`,
|
||||
`USERSERVICE_REDIS_USERNAME`, `USERSERVICE_REDIS_TLS_ENABLED`,
|
||||
`USERSERVICE_REDIS_KEYSPACE_PREFIX` are not set in the deployment
|
||||
(`pkg/redisconn.LoadFromEnv` rejects them with a clear error)
|
||||
|
||||
### Invalid registration context
|
||||
|
||||
|
||||
Reference in New Issue
Block a user