git-hulk commented on issue #1836: URL: https://github.com/apache/kvrocks/issues/1836#issuecomment-1770978229
@EasyProgramming It's a limitation in the scan command when enabling the cluster mode. It'll only look forward N(50) slots when scanning keys, for example: If we have keys: `aaaa`(slot 0), `bbbb`(slot 10), `cccc`(slot 100), `dddd`(slot 200) and we scan with: ``` SCAN "0" MATCH "bb*" ``` it works well since `bbbb` is located at slot 10, and Kvrocks try to look forward next 50 slots. But if you scan with `cc*`: ``` SCAN "0" MATCH "cc*" ``` it will return empty array with cursor(`_bbbb`) since `cccc` is located at slot 100. For the implementation, please refer: https://github.com/apache/kvrocks/blob/unstable/src/storage/redis_db.cc#L365 Of course, for this limitation will make the scan command very hard to use. We will try our best to improve this if possible. cc @tisonkun -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
