# 流 'mystream' 上消费者组 'mygroup' 的待处理条目列表 (PEL) 过大

- **ID:** `redis/stream-consumer-group-pending-entries-overload`
- **领域:** redis
- **类别:** resource_error
- **错误码:** `ERR`
- **验证级别:** ai_generated
- **修复率:** 75%

## 根因

消费者组的待处理条目列表 (PEL) 增长过大，超出了 Redis 内部限制或导致性能下降。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 7.0 | active | — | — |
| 7.2 | active | — | — |
| 8.0-m3 | active | — | — |

## 解决方案

1. ```
   Use XACK to acknowledge processed messages and shrink the PEL. Example: XACK mystream mygroup 1234567890-0 1234567891-0
   ```
2. ```
   Use XAUTOCLAIM to reclaim idle pending messages and acknowledge them programmatically. Example: XAUTOCLAIM mystream mygroup other-consumer 3600000 0-0 COUNT 100
   ```
3. ```
   Monitor and limit the number of pending entries per consumer by setting a maximum processing time and acknowledging messages promptly in application code.
   ```

## 无效尝试

- **Delete and recreate the consumer group without acknowledging pending messages.** — This loses all pending messages and disrupts processing state; messages may be lost permanently. (60% 失败率)
- **Increase the stream's max-length to a very high value.** — The PEL size is not directly tied to stream length; it depends on unacknowledged messages. Increasing max-length does not help. (80% 失败率)
- **Restart the Redis server to clear the PEL.** — The PEL is persisted and will be restored on restart; this only causes downtime without solving the underlying issue. (90% 失败率)
