MongoLeaseStore
The LeaseStore on MongoDB: one document per (group, partition) in wow_lease and one per (group, node), with the node's internal address and the lease groups it serves, in wow_lease_member (one per service and node, its key field holding the service), each keyed by a unique index.
Every operation is one single-document write. An acquisition is a conditional upsert (see conditionalUpsert) whose filter admits only an expired lease or the acquirer's own, and whose pipeline update keeps the epoch when the acquirer still holds the lease live and adds one otherwise. MongoDB re-evaluates the filter after a write conflict, so concurrent acquisitions have exactly one winner. A release keeps the document with expiry 0, so the next acquisition continues its epoch.
Times come from clock, so they are the calling node's: keep the TTL well above the nodes' clock skew. Calls run on dispatcher, virtual threads by default.