Comments (15)
Hello @rolfvandam
Which version of RedisBloom are you using?
from redisbloom-py.
I'm using 0.2.0
from redisbloom-py.
This is what's in d:
>>> d
'\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x88\x16\x8a\xc5\x8c+#@\x07\x00\x00\x00j5\x00\x00\x11'
from redisbloom-py.
Thank you - which version of the server-side RedisBloom module are you using?
from redisbloom-py.
I'm not sure which version number but it was pulled a day or so ago from https://github.com/RedisBloom/RedisBloom
My redis server version is 5.0.3
from redisbloom-py.
Please run MODULE LIST
from redis-cli.
My reasoning for this is that this is related to RedisBloom/RedisBloom#98, which fixes a namespace collision in RedisBloom (with Redis' own hash function).
from redisbloom-py.
127.0.0.1:6379> MODULE LIST
1) 1) "name"
2) "bf"
3) "ver"
4) (integer) 20002
127.0.0.1:6379>
from redisbloom-py.
I've tried it with the latest RedisBloom and the issue is still present.
Also, I've tried it in redis-cli and it gives the same error so it's probably not a problem in this client:
127.0.0.1:6379> BF.SCANDUMP bloom 0
1) (integer) 1
2) "\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x88\x16\x8a\xc5\x8c+#@\a\x00\x00\x00j\x00\x00\x00\n"
127.0.0.1:6379> BF.LOADCHUNK bloom 0 "\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x88\x16\x8a\xc5\x8c+#@\a\x00\x00\x00j\x00\x00\x00\n"
(error) ERR invalid offset - no link found
from redisbloom-py.
@ashtul you've assigned this as a bug on this repo but shouldn't this issue be opened on RedisBloom instead? Is it ok if I open an issue there?
from redisbloom-py.
@rolfvandam , I have looked at the module and I don't think the error is there.
The test you've run fails since the information isn't parsed correctly. The function expects binary and the "/x..." doesn't work well with it.
I hope to find a good solution for parsing soon.
from redisbloom-py.
That's what I thought first too but then I tried doing it directly in Python:
>>> from redisbloom.client import Client
>>> r = Client()
>>> i, d = r.bfScandump('bloom', 0)
>>> type(d)
<class 'bytes'>
>>> d
b'\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x88\x16\x8a\xc5\x8c+#@\x07\x00\x00\x00j5\x00\x00\x11'
>>> r.execute_command('BF.LOADCHUNK', 0, d)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/redis/client.py", line 775, in execute_command
return self.parse_response(connection, command_name, **options)
File "/usr/local/lib/python3.7/dist-packages/redis/client.py", line 789, in parse_response
response = connection.read_response()
File "/usr/local/lib/python3.7/dist-packages/redis/connection.py", line 642, in read_response
raise response
redis.exceptions.ResponseError: invalid offset - no link found
If I understand correctly it should send d
as binary data and it still gives the same error.
from redisbloom-py.
It even gives the same error when I do the same on the socket level:
>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.connect(("127.0.0.1", 6379))
>>> s.send(b"BF.SCANDUMP bloom 0\r\n")
>>> s.recv(100000)
b'*2\r\n:1\r\n$65\r\n\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x88\x16\x8a\xc5\x8c+#@\x07\x00\x00\x00j5\x00\x00\x11\r\n'
>>> s.send(b"BF.LOADCHUNK bloom 0 $65\r\n\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x88\x16\x8a\xc5\x8c+#@\x07\x00\x00\x00j5\x00\x00\x11\r\n")
>>> s.recv(100000)
b'-ERR invalid offset - no link found\r\n'
from redisbloom-py.
Your problem is passing 0
as the second argument to LOADCHUNK
. You need to pass the tuple returned from the corresponding call to SCANDUMP
.
from redisbloom-py.
127.0.0.1:6379> BF.LOADCHUNK bloom 0 "\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x88\x16\x8a\xc5\x8c+#@\a\x00\x00\x00j\x00\x00\x00\n"
(error) ERR not found
127.0.0.1:6379> BF.LOADCHUNK bloom 1 "\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00{\x14\xaeG\xe1z\x84?\x88\x16\x8a\xc5\x8c+#@\a\x00\x00\x00j\x00\x00\x00\n"
OK
from redisbloom-py.
Ah! That explains everything!
It works using redisbloom-py too:
>>> r.execute_command('DEL', 'bloom')
1
>>> r.bfAdd('bloom', 'bla')
1
>>> i, d = r.bfScandump('bloom', 0)
>>> r.delete('bloom')
1
>>> r.bfLoadChunk('bloom', 1, d)
b'OK'
from redisbloom-py.
Related Issues (13)
- Unknown command `BF.RESERVE` HOT 2
- Enhancement to the redisbloom
- Add support for BF.INFO and CF.INFO HOT 1
- redis.exceptions.ResponseError: unknown command `BF.RESERVE`, with args beginning with: `bloom`, `0.01`, `1000` HOT 2
- Support for T-Digest data structure
- format and check the style of Python code in PEP8 compliant manner HOT 3
- Add and expose at runtime in a standard format the __version__ attribute
- How to use bfInfo from redisbloom-py HOT 1
- Latest release (0.4.0) installs incompatible version of redis-py
- Support redis-py 4.1.0 HOT 2
- Why 'cfAddNX' so many misjudgement? HOT 1
- CF.DEL not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redisbloom-py.