jina-ai / annlite

⚡ A fast embedded library for approximate nearest neighbor search
Apache License 2.0
216 stars 22 forks source link

AttributeError: 'builtins.WriteOptions' object has no attribute 'set_sync' #205

Closed tommykoctur closed 1 year ago

tommykoctur commented 1 year ago

Hi am getting this error when indexing using local annlite==0.5.0.

I have no clue what is going on . Can you please help me ?

`ERROR AnnLiteIndexer@429 Traceback (most recent call last): [11/03/22 16:23:31] File "/opt/venv/lib/python3.10/site-packages/annlite/executor.py", line 168, in _index_loop
self._index.extend(batch_docs)
File "/opt/venv/lib/python3.10/site-packages/docarray/array/storage/annlite/seqlike.py", line 19, in extend
self._annlite.index(docs)
File "/opt/venv/lib/python3.10/site-packages/annlite/index.py", line 294, in index
return super(AnnLite, self).insert(x, assigned_cells, docs)
File "/opt/venv/lib/python3.10/site-packages/annlite/container.py", line 285, in insert
self.doc_store(cell_id).insert(docs)
File "/opt/venv/lib/python3.10/site-packages/annlite/storage/kv.py", line 56, in insert
write_opt.set_sync(True)
AttributeError: 'builtins.WriteOptions' object has no attribute 'set_sync'

Exception in thread Thread-3 (_index_loop): Traceback (most recent call last): File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/local/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/opt/venv/lib/python3.10/site-packages/annlite/executor.py", line 172, in _index_loop raise e File "/opt/venv/lib/python3.10/site-packages/annlite/executor.py", line 168, in _index_loop self._index.extend(batch_docs) File "/opt/venv/lib/python3.10/site-packages/docarray/array/storage/annlite/seqlike.py", line 19, in extend self._annlite.index(docs) File "/opt/venv/lib/python3.10/site-packages/annlite/index.py", line 294, in index return super(AnnLite, self).insert(x, assigned_cells, docs) File "/opt/venv/lib/python3.10/site-packages/annlite/container.py", line 285, in insert self.doc_store(cell_id).insert(docs) File "/opt/venv/lib/python3.10/site-packages/annlite/storage/kv.py", line 56, in insert write_opt.set_sync(True) AttributeError: 'builtins.WriteOptions' object has no attribute 'set_sync'`

numb3r3 commented 1 year ago

Thanks for your pointing out. I think this is due to an upstream issue from rocksdict. It has a broken change in the latest release v0.3.0. We will adopt it ASAP.

numb3r3 commented 1 year ago

FYI, this issue will be closed by this https://github.com/jina-ai/annlite/pull/206, and will be released a patch v0.5.4