Requires Memento 3.0.89 or later and its arbitrary secondary-ID API. Memento 2.x tag-based
invalidation is not compatible with this release.
Replace Memento 2.x tag usage with secondary IDs: use with-sec-id instead of tag wrappers and
memo-clear-sec-id! instead of tag invalidation helpers.
Redis secondary-index metadata has changed: secondary indexes are now shared by Redis
connection/key-generator domain instead of scoped by cache name, and entries use reverse-index
records. Clear all Memento Redis entries and metadata before upgrading from 2.x; do not run 2.x
and 3.0 writers against the same keyspace concurrently.
If the keyspace is not cleared immediately, ordinary non-indexed entries remain readable. The
affected entries are those written with 2.x tag/secondary metadata: they can remain readable after
a 3.0 secondary-ID invalidation because they have no 3.0 reverse-index record. They are eventually
replaced or removed by normal cache writes, explicit clears, or expiry.
To clear a keyspace before upgrading, run (memento.redis/nuke!! #'your.memoized/function) from
an application configured with the same Redis connection and key generator. Repeat for each
distinct Redis database/connection/key-generator combination.
Custom KeysGenerator implementations must be updated:epoch-key and sec-index-id-key
changed arity and semantics; sec-id-epochs-key, active-invalidation-records-key,
active-invalidation-key, and entry-sec-index-key are now required.
Secondary-index invalidation now uses Memento's backend lifecycle hooks and
Redis-native epochs exclusively; mount tags and JVM epoch listeners are no longer required.
Active secondary-ID invalidations use leased Redis records, preventing loads in any JVM
from publishing matching entries or fetching them as hits during with-invalidation write intervals.
Secondary-ID indexes now span cache names within a Redis connection/key-generator domain.
Entry reverse indexes remove obsolete secondary-ID memberships atomically on replacement.
Owner waits on Load use MaintenanceWait.ForeignLoad,
MaintenanceWait.InvalidationRecord, and MaintenanceWait.SecondaryIds. After maintenance
notification, the same local owner retries full fetch.lua; joiners continue awaiting its final
RedisPromise result.
Maintenance polling is status-only: it never transfers cached values, removes loads, or
completes/rejects result promises. Notifications check both load and wait identity.
Every owner fetch attempt uses a fresh claim token. Marker refresh includes only non-null
candidate/owned markers and is protected by Redis token equality, never refreshing foreign markers.
Invalidation waits retain their configurable 60-second default timeout. Foreign-load waits
remain interruptible without an added timeout. Invalidation is centralized per domain, with
no Pub/Sub listener or invalidation count maps; the old JVM Pub/Sub invalidation mechanism was removed.
Successful results are linearized at the Redis fetch or successful load completion. Already-attached
callers share the result even if Redis invalidation occurs before delivery; they do not all reread
after successful loading or polling. Fresh calls after local load removal reread Redis.
Redis wire format has changed. Entries written by 1.x are not
compatible with 2.0.x. You do not have to wipe Redis before upgrading: on
first access to a 1.x key, 2.0.x treats it as stale, drops it, and
recomputes the value into the new format. Old entries self-heal lazily as
they are read. If you prefer to clear all old entries up front, run
(memento.redis/nuke!! #'your.memoized/function) from an application
process configured with the same Redis connection and key generator as
the cache (once per distinct connection / :memento.redis/keygen). Do
not run 1.x and 2.0.x writers against the same Redis keyspace
concurrently. See the README "Upgrade Note" section for details.
Requires Memento 2.1.74 or later.
Cached nil values now round-trip correctly and remain visible in as-map.
if-cached no longer blocks on in-flight loads and no longer rethrows
loader exceptions; it returns the absent sentinel when no completed entry
is available.
Same-JVM callers arriving while a load is in flight now reliably coalesce
onto the in-flight load instead of starting a redundant one.
Improved cleanup of load markers and tag-invalidation metadata on
invalidation and on stale-tag rejection.
Add Redis cache epoch key helpers for upcoming Redis-authoritative tag invalidation.
Tag-aware invalidation is now Redis-authoritative: a per-cache epoch counter and
per-tag-id epoch hash are kept in Redis, and loaders consult them in the
finish-load Lua script. A load whose tags were invalidated mid-flight is
rejected and joiners re-loop instead of caching a stale value.
Pub/Sub invalidation channel bumped to mem-redis-inval-v2 to accommodate the
new payload shape. Rolling restarts across this version boundary will see
invalidations propagate only within each cohort until the cutover completes;
on-disk entry format is unchanged.
fixes issues with concurrent access to same keys triggering multiple Redis accesses, important concurrency fixes
if an exception is thrown by the cached function, all threads awaiting the same key will get the same exception at once, before each thread would attempt to call the function serially
specify per entry TTL with :memento.redis/ttl-fn
specify expiry on function bind instead of cache
invalidations during the load will cause value to be recalculated