ERR
redis
data_error
ai_generated
partial
错误:在流'mystream'上检测到消费者组'mygroup'的PEL损坏
ERR PEL corruption detected for consumer group 'mygroup' on stream 'mystream'
ID: redis/stream-consumer-group-pel-corruption
78%修复率
82%置信度
1证据数
2024-02-10首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 6.2.6 | active | — | — | — |
| 7.0.8 | active | — | — | — |
| 7.2.4 | active | — | — | — |
根因分析
消费者组的待处理条目列表(PEL)已损坏,通常是由于异常关闭或流实现中的错误导致内部状态不一致。
English
The Pending Entries List (PEL) for a consumer group has become corrupted, typically due to an abnormal shutdown or a bug in stream implementation leading to inconsistent internal state.
官方文档
https://redis.io/commands/xgroup-setid/解决方案
-
使用 `XGROUP SETID mystream mygroup 0-0` 将最后交付的ID重置为开头,然后使用 `XACK mystream mygroup <id1> <id2> ...` 手动确认所有待处理条目以清除PEL。
-
如果流不重要,使用 `XREAD COUNT 10000 STREAMS mystream 0` 将流备份,然后删除并重新创建流和消费者组,并重放消息。
无效尝试
常见但无效的做法:
-
70% 失败
Deleting and recreating the consumer group loses all pending messages and consumer progress, which may cause data loss for unprocessed entries.
-
90% 失败
Restarting the Redis server does not repair PEL corruption; the corruption persists in the RDB or AOF file.