-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object not found. #57
Comments
Any solution for this |
That's really odd... can you set up a script I can try to reproduce this? |
Just speculating, but are there any save operations going on in a separate thread/process? The model save operation does a delete as part of the update process. This could potentially introduce very small timing windows where other processes would experience exactly these failures. |
Another thought. Would a lua script that sets all the key/value pairs of a model in an atomic operation potentially avoid having to do that delete operation during a save? |
👍 |
I have the same issue when using a Model to share status between two or more workers. So, can I say that now Walrus models are not thread-safe? |
Has nothing to do with thread-safety. Redis is single-threaded, after all. |
I also run into KeyErrors when there are two workers interacting with the same db: one is iterating through a Model.query() result while the other one is modifying/deleting model objects. |
Yea there's no isolation. I strongly advise to use a relational db. |
I am experiencing this as well. Isn't this something solved by doing the save using a pipeline. I think the problem is just finding the data in one index before it is in another. Pipelines atomically write. |
I got around this by
|
Yeah, definitely a nice performance boost, but sort of sep from the main issue. As is, without using a basic pipeline, I think |
No one should be using the walrus models code. I need to put a warning in the docs to that effect. It was an experiment and yeah it kinda works, but it's definitely nothing I would ever use myself and that is a big red flag to me. |
That statement confuses me honestly. There are many use cases for Redis in which a modeled approach to transient data makes sense, to hide the complexity of the various data structures. That is how I landed here. I was doing the sorts of things you are doing, on my own, but then found Walrus. I have a case in which I most definitely do not want a relational database (very high throughput of transient objects). I get though that it is your project and you want to deprecate that feature. |
https://walrus.readthedocs.io/en/latest/models.html
I do not intend to "deprecate" anything, and I did not intend to give that impression. What I do want to convey is that the implementation has a lot of rough edges and is too flaky for me to ever want to use it. I feel it is necessary to put a warning up that the code is "experimental"-quality, so that people can re-evaluate walrus if they are expecting some kind of stability guarantee. |
There is some moment that it is not possible to return an object and everything spoils. When I try to pull a list with all objects nothing else works. I could not detect exactly when this occurs, sometimes it looks like it was after using delete(). But I can say that it is unstable.
See that in the object list I have an object that is marked as indexable, when I do a query looking specifically for that object it also bursts the same error.
or: uuid.UUID('46981222-d147-48de-aba2-e63133d2491d')):
After the error starts happening, not even the method to delete all records of that type of object does:
The text was updated successfully, but these errors were encountered: