Operations Runbook
This runbook covers the coordinator control plane. Application message handling, retry, DLQ, and idempotency remain in the consumer application.
Health Checks
Issue an operator token. Tokens expire after seven days by default.
read -rsp 'Coordinator password: ' RSC_PASSWORD
echo
RSC_TOKEN="$(
curl -sS -H 'Content-Type: application/json' \
-X POST http://localhost:8080/coord/v1/auth/login \
-d "{\"username\":\"admin\",\"password\":\"${RSC_PASSWORD}\"}" |
jq -r '.accessToken'
)"
unset RSC_PASSWORD
Coordinator health:
curl -H "Authorization: Bearer ${RSC_TOKEN}" \
http://localhost:8080/coord/v1/monitoring/health
Interpretation:
| Field | Meaning |
|---|---|
status=UP |
Coordinator HTTP API and configured dependencies are healthy. |
status=DEGRADED |
Coordinator is up but Redis health is down. |
redis=NOT_CONFIGURED |
Redis is not required by the active coordinator configuration, or no Redis connection factory is configured. |
Common Operator Checks
List groups:
curl -H "Authorization: Bearer ${RSC_TOKEN}" \
http://localhost:8080/coord/v1/monitoring/groups
Inspect assignments:
curl -H "Authorization: Bearer ${RSC_TOKEN}" \
http://localhost:8080/coord/v1/monitoring/streams/orders/groups/orders-consumer/assignments
Inspect migrations:
curl -H "Authorization: Bearer ${RSC_TOKEN}" \
http://localhost:8080/coord/v1/monitoring/streams/orders/groups/orders-consumer/migrations
Terraform And GitOps Admin Mutations
Production admin mutations should be applied through Terraform or another GitOps workflow when possible.
Recommended pattern:
- Review desired changes in a pull request.
- Run plan against coordinator read APIs.
- Apply with a dedicated
WRITEprincipal. - Send
X-Request-Idand request body fieldsrequestedByandreason. - Verify coordinator audit logs and monitoring APIs after apply.
Terraform manages desired state such as group existence and shard count. It does not manage consumer runtime concurrency, heartbeats, current assignments, revoke progress, offsets, pending entries, or message payloads.
Coordinator audit remains required even when Terraform is the caller. It records the actual API request, outcome, status, principal, roles, request id, request body fingerprint, client address, duration, stream prefix, consumer group, and operation reason.
Alerts
Alert on:
- coordinator health
DEGRADED - Redis connection failures
redis_stream_coord_member_expired_totalspikeredis_stream_coord_member_heartbeat_age_secondsapproaching the member lease TTLredis_stream_coord_member_lease_remaining_secondsrepeatedly reaching zero for active membersredis_stream_coord_revoke_pendingremaining non-zero longer than the application rebalance timeoutredis_stream_coord_invariant_violation_totalincreasingredis_stream_coord_state_conflict_totalincreasing rapidlyredis_stream_coord_consumer_shard_pendingremaining high for a member/shardredis_stream_coord_consumer_shard_progress_age_secondsbecoming stale while the member is activeredis_stream_coord_producer_routing_request_total{status="ERROR"}increasing- active migration age exceeding the expected drain window
- repeated
429responses from admin automation
Rebalance Triage
- Check member liveness with the members monitoring API.
- Check assignments and
revokeProgress. - If a member is stuck revoking shards, inspect that application instance for slow handlers or blocked shutdown.
- If the rebalance timeout expires, the coordinator fences the stuck member and allows reassignment to continue.
- Consumers that receive
FENCED_MEMBER_EPOCHmust stop local ownership and rejoin withmemberEpoch=0.
Migration Triage
- Confirm producer routing metadata points to the expected
shardCount. - Confirm live consumers have converged to target assignments.
- Check whether removed shards are still reported in
currentAssignmentsorrevokeProgress. - If the active migration is unsafe, use the rollback API while rollback is still allowed.
Shard Scale Procedure
For at-least-once producer workloads that tolerate duplicates, shard scale-out/in can be performed online through the coordinator scale API.
For duplicate-sensitive workloads:
- Pause producers for the target
streamPrefixandconsumerGroup. - Wait until in-flight
XADDcalls and publish retry windows are drained. - Call the coordinator scale API.
- Wait for producer routing metadata to expose the new
shardCount. - Refresh producer routing caches.
- Resume producers.
This is required because the same event id can be published to old and new shard counts if scaling occurs while produce retries are still active. The project does not provide global deduplication or a single-processing guarantee.
Upgrade Procedure
- Read the release notes and compatibility matrix.
- Confirm the coordinator supports the coordination version range used by existing consumers.
- Back up coordinator Redis metadata keys.
- Deploy the new coordinator version.
- Verify
/coord/v1/monitoring/health. - Roll consumer applications gradually.
- Watch member expiry, rebalance duration, revoke pending, and invariant metrics.
Redis Metadata Backup
Coordinator metadata lives in one Redis hash key per group:
redis-stream:coord:{streamPrefix:consumerGroup}:metadata
Back up coordinator metadata keys before schema-changing upgrades and before manual repair operations.
Metadata Durability
The Redis metadata key is the coordinator source of truth for a group. The coordinator treats client-reported versions as observations only. If a consumer reports a higher metadataVersion than Redis currently stores, the coordinator asks consumers to synchronize down to the current Redis metadata with retry-safe SYNC_METADATA instead of trusting the client version. After the consumer reports the current version, it receives REVOKE_PENDING while revoke/drain is still blocking handoff and receives OK only when newly assigned shards may be started.
Recommended production controls:
- Use managed Redis persistence and backups appropriate for the deployment.
- Keep coordinator metadata keys under a dedicated
coordinator.store.key-prefix. - Do not let application runtime users delete coordinator metadata keys.
- Back up coordinator metadata keys before schema-changing upgrades or manual maintenance.
- Treat Redis restore to an older backup as disaster recovery, not as a normal retry path.
Watch for metadata rollback signals:
- A consumer heartbeat reports a higher previously seen
metadataVersion,assignmentEpoch, ormemberEpochthan the coordinator currently stores. - A producer routing cache has observed a higher
metadataVersionthan the coordinator returns. - Coordinator metrics report metadata version regression or store revision regression.
- Rebalance state appears to move backward, such as a shard returning from released to revoking without a new assignment epoch.
Redis metadata has an important limitation: if Redis rolls back and no surviving consumer or producer can report the higher observed version, the rollback can be invisible to the coordinator.
If a source-of-truth metadata key is lost or Redis is restored to an older backup:
- Stop admin mutations for the affected group.
- Confirm whether the key was deleted, corrupted, or restored from an older backup.
- Restore metadata from backup when possible.
- If backup is unavailable or older than the highest client-observed version, explicitly recreate the group with the expected shard count and treat consumers/producers as a new group lifecycle.
- Do not rely on consumer heartbeats, producer routing caches, or stale local state to reconstruct group metadata automatically.
- Do not force clients to downgrade to a lower metadata version; fail closed until repair or recreation is complete.
- Do not repair by only incrementing the rolled-back version number. The lost transition contents may include drain, release, shard scale, or routing decisions that cannot be inferred safely.