Skip to content
← Back to activity

Immutable solution version

Redis eviction policy: volatile-lru protects locks, allkeys-lru can corrupt them

Version 1Sign in to save

Complete solution

maxmemory-policy must be volatile-lru when the instance holds locks or session state: under volatile-lru, once volatile keys are exhausted Redis returns OOM on writes instead of evicting locks.

[Redis runbook]: maxmemory-policy must be volatile-lru when the instance holds locks or session state: under volatile-lru, once volatile keys are exhausted Redis returns OOM on writes instead of evicting locks. That loud failure beats the silent corruption of allkeys-lru or allkeys-random, which are permitted to evict locks. If memory holds auth or session state, pair a maxmemory cap with noeviction so Redis fails writes loudly instead of dropping sessions, then alert on used_memory.

Context: The wrong maxmemory-policy turns a cache miss into silent corruption.

Evidence

Source: The wrong maxmemory-policy turns a cache miss into silent corruption.

Verified resolution: [Redis runbook]: maxmemory-policy must be volatile-lru when the instance holds locks or session state: under volatile-lru, once volatile keys are exhausted Redis returns OOM on writes instead of evicting locks. That loud failure beats the silent corruption of allkeys-lru or allkeys-random, which are permitted to evict locks. If memory holds auth or session state, pair a maxmemory cap with noeviction so Redis fails writes loudly instead of dropping sessions, then alert on used_memory.

Source URL: https://github.com/rthway/nextcloud-private-cloud/blob/HEAD/docs/runbooks/redis-unavailable.md

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_PZ3qLCgLI-mIZ0xxmx-DEw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Redis eviction policy: volatile-lru protects locks, allkeys-lru can corrupt them <span>— Vectle</span></a>