Repository navigation
Tags: celikgo/CacheLib
Tags
v1.6.0 — Incr RPC for fixed-window rate-limit buckets
New RPC
-------
rpc Incr(IncrRequest) returns (IncrResponse)
message IncrRequest {
string key = 1;
int64 delta = 2; // amount to add (typically 1)
int64 ttl_seconds = 3; // applied only on miss (window seal)
}
message IncrResponse {
int64 value = 1; // counter value after this increment
bool ttl_set = 2; // true on miss (first write of window), false on hit
}
Atomicity contract
------------------
* On miss: key created with value=delta and TTL=ttl_seconds in a
single atomic operation. ttl_set=true.
* On hit: counter atomically incremented; existing TTL untouched.
ttl_set=false.
This is what fixed-window rate limiting requires: the first request of a
window seals the window, subsequent hits within the window do not slide
the TTL forward.
Distinct from the existing Increment RPC, whose semantics override the
TTL whenever one is supplied.
Why this exists
---------------
Discovery server's tier-aware rate-limit buckets (B-6) and the
customer-server equivalent need a single RPC that increments a counter
AND establishes the window TTL on first write, atomically. Building
this on top of Set-then-Increment leaks the window seal across two
calls and races under concurrent first-request fan-in.
Compatibility
-------------
Additive only. Existing RPCs (Get, Set, SetNX, Increment, Decrement,
CompareAndSwap, GetTTL, Touch, Delete, MultiGet, MultiSet, MultiDelete,
Scan, Stats) are unchanged. No proto field renumbering. Clients on
v1.5.x continue to work; only callers of the new Incr method need
the v1.6.0 server.
Docker images
-------------
ghcr.io/celikgo/cachelib-grpc-server:1.6.0 (multi-arch)
ghcr.io/celikgo/cachelib-grpc-server:1.6.0-amd64 (single-arch sibling)
Source files
------------
standalone_server/proto/cache.proto
standalone_server/CacheManager.{h,cc}
standalone_server/CacheServiceImpl.{h,cc}
Fix Docker build: copy magic_enum headers for upstream EventSink.h Upstream CacheLib now includes <magic_enum/magic_enum.hpp> in EventSink.h. Copy the getdeps-installed magic_enum headers into the CacheLib install tree so the standalone server build can find them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Release v1.3.0: reflection, Pipeline, MultiDelete, Prometheus metrics New features addressing Spring Boot integration team feedback: - gRPC server reflection for service discovery without proto files - MultiDelete RPC for batch key deletion - Pipeline bidirectional streaming RPC for mixed operations - Prometheus metrics endpoint on port 9090 (GET /metrics) - grpc_health_probe binary bundled in Docker image - CAS TTL convention fix (0=no expiry, keep_ttl field added) - Updated documentation and release notes for v1.3.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>