apache / kvrocks

Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol.
https://kvrocks.apache.org/
Apache License 2.0
3.55k stars 466 forks source link

there is a bug with hscan_iter #737

Closed luger1990 closed 2 years ago

luger1990 commented 2 years ago

Search before asking

Version

2.0.6

Minimal reproduce step

master = my_sentinel.master_for(master_name, socket_timeout=2000, password=password)
key = "u:uuid:20220718"
for u, uuid in master.hscan_iter(name=key, count=500):
    print(u, uuid)

What did you expect to see?

key, value output

What did you see instead?

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
  File "xxx.py", line 60, in <module>
    update()
  File "song_rec_history_update.py", line 32, in update
    for item in master.hscan_iter(name=key):
  File "/usr/local/lib/python3.8/dist-packages/redis/commands/core.py", line 3002, in hscan_iter
    cursor, data = self.hscan(name, cursor=cursor, match=match, count=count)
  File "/usr/local/lib/python3.8/dist-packages/redis/commands/core.py", line 2984, in hscan
    return self.execute_command("HSCAN", *pieces)
  File "/usr/local/lib/python3.8/dist-packages/redis/client.py", line 1227, in execute_command
    return conn.retry.call_with_retry(
  File "/usr/local/lib/python3.8/dist-packages/redis/retry.py", line 46, in call_with_retry
    return do()
  File "/usr/local/lib/python3.8/dist-packages/redis/client.py", line 1228, in <lambda>
    lambda: self._send_command_parse_response(
  File "/usr/local/lib/python3.8/dist-packages/redis/client.py", line 1204, in _send_command_parse_response
    return self.parse_response(conn, command_name, **options)
  File "/usr/local/lib/python3.8/dist-packages/redis/client.py", line 1249, in parse_response
    return self.response_callbacks[command_name](response, **options)
  File "/usr/local/lib/python3.8/dist-packages/redis/client.py", line 394, in parse_hscan
    return int(cursor), r and pairs_to_dict(r) or {}
ValueError: invalid literal for int() with base 10: b'001947E61B404408A0FE96500AE7D7F8'

Anything Else?

origin_img_v2_810b0a51-158c-40fd-8352-aaa88e57c7ch

Are you willing to submit a PR?

ShooterIT commented 2 years ago

Hi @luger1990 FYI https://github.com/apache/incubator-kvrocks/discussions/417

luger1990 commented 2 years ago

Hi @luger1990 FYI #417

but why pika can support this?

git-hulk commented 2 years ago

Hi @luger1990 FYI #417

but why pika can support this?

The design internal is different, but very happy to see anyone who would like to improve it.

git-hulk commented 2 years ago

Will close this issue if we have no further discussion, feel free to reopen if needed.