{
  "id": "redis/eviction-policy-mismatch",
  "signature": "WARNING: Eviction policy 'allkeys-lru' not compatible with 'maxmemory-policy' setting on replica",
  "signature_zh": "警告：驱逐策略 'allkeys-lru' 与副本上的 'maxmemory-policy' 设置不兼容",
  "regex": "WARNING: Eviction policy '.*' not compatible with 'maxmemory-policy' setting on replica",
  "domain": "redis",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The eviction policy configured on a replica node differs from the master's policy, causing inconsistent memory management during replication.",
  "root_cause_type": "generic",
  "root_cause_zh": "副本节点上配置的驱逐策略与主节点的策略不同，导致复制期间内存管理不一致。",
  "versions": [
    {
      "version": "Redis 6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 7.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Ignore the warning, assuming it's harmless",
      "why_fails": "Can lead to data inconsistency between master and replica, or unexpected evictions on replica.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Set a different policy on the replica without matching the master",
      "why_fails": "Replicas must follow the master's eviction policy to maintain consistency; otherwise, replication may fail.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Align the replica's maxmemory-policy with the master: CONFIG SET maxmemory-policy allkeys-lru on the replica (or match the master's policy).",
      "success_rate": 0.9,
      "how": "Align the replica's maxmemory-policy with the master: CONFIG SET maxmemory-policy allkeys-lru on the replica (or match the master's policy).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check both configurations: redis-cli CONFIG GET maxmemory-policy on master and replica, then update the replica's config file permanently.",
      "success_rate": 0.85,
      "how": "Check both configurations: redis-cli CONFIG GET maxmemory-policy on master and replica, then update the replica's config file permanently.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将副本的 maxmemory-policy 与主节点对齐：在副本上运行 CONFIG SET maxmemory-policy allkeys-lru（或匹配主节点的策略）。",
    "检查两个配置：在主节点和副本上运行 redis-cli CONFIG GET maxmemory-policy，然后永久更新副本的配置文件。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://redis.io/docs/latest/operate/oss_and_stack/management/eviction/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}