kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

[bug] xpending not include the end

Open i18nsite opened this issue 3 weeks ago • 0 comments

Search before asking

  • [x] I had searched in the issues and found no similar issues.

Version

kvrocks_version:2.14.0

Minimal reproduce step

# 1. 清理旧数据
DEL smtp

# 2. 创建 Consumer Group (send),同时创建流 (smtp),从 0 开始消费
XGROUP CREATE smtp send 0 MKSTREAM

# 3. 构造指定 ID 的消息
XADD smtp 1764415413212-0 type "bug_repro"

# 4. 首次读取:让消息进入 Pending 状态 (Delivery Count = 1)
#    此时消费者为 "test"
XREADGROUP GROUP send test COUNT 1 STREAMS smtp >

# 5. 再次认领并篡改状态:
#    使用 XCLAIM 强制将消息归属给 "test" (FORCE)
#    将 Delivery Count 增加 (此时变为 2)
#    强制设置空闲时间为 33444572 毫秒 (IDLE 33444572)
XCLAIM smtp send test 0 1764415413212-0 IDLE 33444572 FORCE

# ==========================================
# 下面开始演示 Bug 现象
# ==========================================

# 6. 第一步:运行指定 ID 范围的 XPENDING (你提到的返回为空的命令)
#    期望:应该返回 1 条数据
#    实际(Bug场景):(empty list or set)
XPENDING smtp send 1764415413212-0 1764415413212-0 1

# 7. 第二步:运行全范围 XPENDING (你提到的能查到的命令)
#    期望:返回包含 id, consumer(test), idle(33444572), count(2) 的数据
XPENDING smtp send - + 1

# 8. 第三步:再次运行指定 ID 范围确认
XPENDING smtp send 1764415413212-0 1764415413212-0 1

What did you expect to see?

输出应该包含end

What did you see instead?

没有包含end

XPENDING 和 xrange 一样,都要包含end

https://redis.io/docs/latest/commands/xrange/ Image

i18nsite avatar Nov 30 '25 00:11 i18nsite