- Counter#increment now seeds a missing key at the delta (Redis INCR/INCRBY
semantics). Couchbase's native increment seeds at 'initial' and ignores the
delta on creation, so the first INCR returned 0 — a drop-in replacement that
silently undercounts by one is exactly the kind of bug nobody ever finds.
Explicit initial: still overrides. Decrement keeps initial: 0 and its
unsigned clamp-at-zero divergence from Redis is now documented and tested.
- Lock#release requires the CAS handle: passing nil used to delete the lock
document unconditionally, so any caller could unlock a lock it never held.
force_release! is the explicit administrative override.
- Lock#acquire validates a positive ttl — a nil/zero ttl would create a lock
that survives its holder's crash forever.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>