Changelog
Changelog
Notable changes to distkit, newest first.
A high-level history of distkit releases. For the full commit log, see the GitHub releases.
0.7.2 — 2026-11-05
- Fixed:
LaxInstanceAwareCounterreads no longer miss this instance's own writes while a flush is in flight. Between swapping the buffered delta out and applying the Redis reply,get,inc_ifand the other read paths returned values short by the in-flight amount for a full Redis round trip, which could make conditional updates such asinc_if(Gt(0), -1)skip an update that should have applied. Each key now tracks its in-flight amount, every read includes it, and a comparator check and its update run in one step. - Fixed: a flush that failed no longer loses or re-sends deltas. A failed flush inside
set,del,clearor their variants dropped the swapped delta, and a background flush that failed after part of a multi-chunk batch was applied sent the applied part again, which double-counted (both lax counters). Confirmed chunks now settle at once and unconfirmed amounts return to the buffer for the next flush. A flush that a connection failure interrupts stays at-least-once: the unconfirmed amount is retried and can apply twice. - Fixed:
set_on_instanceandset_all_on_instanceno longer overshoot the instance slice when called while a flush is in flight. - Fixed: a flush reply that arrives after
delremoved a key no longer re-creates a stale cache entry for that key. - Fixed: on a quiet instance, a buffered write could wait up to an activity epoch (15 s) before flushing. The flush task now drains the buffer before it goes idle, and the first write on an idle instance wakes it at once. Applies to
LaxCounterandLaxInstanceAwareCounter. - Counters now delete a record that reaches 0, since a missing record reads as 0. The plain counters delete the hash field; the instance-aware counters delete an instance's slice field when that slice reaches 0, and the shared record only when no registered instance, dead-but-unreaped ones included, holds a field for the key — a key held at -1 and +1 keeps its records.
set(key, 0)deletes the storage and keeps the epoch bump, asdeldoes. - New
cleanup_interval: Option<Duration>on all three options structs (defaultNone: no task). When set, a background task sweeps the counter's records on that interval: it deletes records at 0 that older versions left behind, reaps dead instances on a timer instead of waiting for traffic, and deletes shared records that no instance holds. Scans are budgeted to about 10,000 fields per tick and resume across ticks.
0.7.1 — 2026-10-10
- Fixed:
StrictInstanceAwareCounterandLaxInstanceAwareCounterno longer fail withtoo many results to unpackafter an instance dies. In 0.7.0 and earlier versions, all calls exceptclearfailed for a counter with more than approximately 8,000 keys, and the counter did not recover. The cleanup now reads the counts of the dead instance, not all keys of the counter. A deployment that fails today recovers on its first call after the upgrade. No manual Redis step is necessary. - Dead-instance cleanup now has a limit for each call. One call removes dead instances until it has read approximately 10,000 of their counts. The next calls remove the dead instances that stay.
- Fixed:
clear_on_instanceno longer fails when the instance holds more than approximately 8,000 keys. - Fixed:
RwLockno longer fails to acquire when more than approximately 8,000 reader entries or pending-writer entries expire together. - The heartbeat of the instance-aware counters now logs an error when it fails. Before, it ignored the error.
0.7.0 — 2026-08-08
- Breaking: upgraded the optional
distkit::trypemare-export from Trypema 1 to Trypema 2. The monolithicRateLimiterand option structs are replaced by independently constructedLocalRateLimiterProvider,RedisRateLimiterProvider, andHybridRateLimiterProvidervalues using the sharedRateLimiterBuildertrait. - Configuration now uses semantic, unit-aware types:
WindowSize,BucketSize,SuppressionFactorCachePeriod, andSyncIntervalreplace their unit-suffixed v1 counterparts. RateLimitnow uses constructors such asper_second, and rejected decisions exposeretry_after: Durationinstead ofretry_after_ms.- The
trypemafeature name anddistkit::trypemamodule path are unchanged. See the rate-limiting migration guide.
0.6.0 — 2026-06-26
- Breaking: the guard inspectors
get_stateandget_on_attemptare no longerasync. Both only read locally cached state (anAtomicBooland a storedusize) and never touched Redis, so theasyncwas unnecessary. Drop the.awaitat call sites:guard.get_state()andguard.get_on_attempt(). AffectsMutexGuard,RwLockReadGuard, andRwLockWriteGuard.
0.5.3 — 2026-06-17
- New bounded acquisition methods that source the poll interval from the lock's configured
retry_intervalinstead of taking it per call:try_lock_with_timeout/try_read_with_timeout/try_write_with_timeouttake only atimeoutand returnLockError::Timeoutif the deadline passes.try_lock_with_retries/try_read_with_retries/try_write_with_retriesbound by attempt count instead of time:max_retriesretries after the initial attempt, returning the newLockError::RetriesExhausted { retries }when every attempt fails.
- Deprecated
try_lock_for/try_read_for/try_write_for(the(timeout, retry_interval)forms) in favor of the*_with_timeoutmethods.
0.5.2 — 2026-06-17
- Lock guards now expose
get_on_attempt: the zero-based acquire poll that obtained the lock —0when the first poll succeeded, higher when the acquire waited through contention (a one-shottry_*is always0). Available onMutexGuard,RwLockReadGuard, andRwLockWriteGuard. Useful for contention metrics and backoff tuning.
0.5.1 — 2026-06-16
- Documentation updates.
0.5.0 — 2026-06-15
The distributed locks release.
- New
lockfeature: Redis-backedMutexand a writer-preferringRwLock, mirroringtokio::sync. - RAII guards with background lease renewal (every
ttl/3) and an awaitablerelease(). - Unified
LockGuardState(Acquired/Lost/Released) across all guard types. - TTL and owner are validated up front before any Redis operation.
- Added lock benchmarks.
0.4.0 — 2026-04-13
- Stability and internal refinements across counters and instance-aware counters.
0.3.0 — 2026-04-13
- Continued hardening of the counter and instance-aware counter paths.
0.2.3 — 2026-04-08
- Added the
fullfeature flag to enable every primitive at once.
0.2.0 — 2026-04-03
- Added instance-aware counters (
StrictInstanceAwareCounter,LaxInstanceAwareCounter) with automatic dead-instance cleanup. - Added the
trypemafeature: sliding-window rate limiting re-exported underdistkit::trypema. counterandinstance-aware-counterare the default features.
0.1.0 — 2026-03-29
- Initial release: distributed
StrictCounterandLaxCounter, backed by Redis.

