Distributed Lock Audit

Review every lock, lease and leader election in a service. For each, decide whether it exists for efficiency (a duplicate only wastes work) or correctness (a duplicate corrupts data); a TTL lock alone never protects correctness because a holder can pause past its lease and still write, so the resource must reject stale holders with a fencing token, or the lock should be replaced by a constraint or compare-and-swap. Covers Redis SET NX, Redlock, etcd, ZooKeeper, Consul, Kubernetes Lease and Postgres advisory locks. Use when you hear "is Redlock safe", "the lock expired while the holder was still writing", "even though we have a lock two pods ran the job", "use a Redis lock to stop double processing", "leader election with etcd". Not for cache-fill leases (application-caching), anomalies inside one database (transaction-race-hunt), delivery duplicates (event-driven-reliability), single-pod scheduling (scheduled-job-reliability).

greenblacked Updated
The twenty-nine plugins: coding, family, gamedev, operations, delivery, security, manager, personal, career, design, llm, data, techdocs, assurance, client-apps

File contents

greenblacked/AI commit 6b643263c7

Frequently asked questions

npx get-skill add greenblacked/distributed-lock-audit