Closed szuecs closed 6 months ago
Hi @szuecs,
Thank you for sharing your use case. However, your use case is ZRANGEBYSCORE, not ZREMRANGEBYSCORE.
It looks like ZREMRANGEBYSCORE doesn't support the WITHSCORES and LIMIT options you are going to add.
@rueian oops, yes true. We have ZREMRANGEBYSCORE https://github.com/zalando/skipper/blob/678fc5a604483a527e6b69645f497675e020328c/net/redisclient.go#L421 but you are of course right no WTIHSCORES and LIMIT. Somehow I got wrong by scrolling what commands could be missing, but all commands we need seem to be implemented. Thanks for your time looking into it!
feature: add ZREMRANGEBYSCORE with additional limit
context: go-redis https://pkg.go.dev/github.com/go-redis/redis\#Client.ZRangeByScoreWithScores has this, which we use in https://github.com/zalando/skipper/blob/678fc5a604483a527e6b69645f497675e020328c/net/redisclient.go\#L431-L448 to implement one part of a timewindow based rate limit in https://github.com/zalando/skipper/blob/678fc5a604483a527e6b69645f497675e020328c/ratelimit/redis.go\#L235