# Elasticsearch异常：索引生命周期策略 [my_policy] 未能滚动索引 [logs-2025.03.15] - 条件 [max_age: 30d] 未满足，实际年龄 [25d]

- **ID:** `elasticsearch/index-lifecycle-policy-rollover-failure`
- **领域:** elasticsearch
- **类别:** config_error
- **错误码:** `ES_ILM_ROLLOVER_FAIL`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

ILM 滚动条件（max_age、max_docs 或 max_size）未满足，因为索引是使用别名手动创建的，导致滚动被跳过或配置错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 7.17.0 | active | — | — |
| 8.11.0 | active | — | — |
| 8.12.0 | active | — | — |

## 解决方案

1. ```
   Ensure the index is part of an alias with `is_write_index: true` and that the rollover alias matches the policy's `rollover_alias` setting. Use `PUT _ilm/policy/my_policy` to correct the alias name.
   ```
2. ```
   Force rollover manually by calling `POST /logs-2025.03.15/_rollover` with the required conditions, then check ILM status with `GET logs-2025.03.15/_ilm/explain`.
   ```
3. ```
   Delete the index and recreate it with proper alias configuration: `PUT /logs-2025.03.15-000001 { "aliases": { "logs_write": { "is_write_index": true } } }`.
   ```

## 无效尝试

- **** — Index creation date is immutable; modifying it via update doesn't affect ILM's internal tracking. (95% 失败率)
- **** — Loses automated lifecycle management, requiring manual intervention for each rollover and deletion. (80% 失败率)
