-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Queries not showing with hash indexes #3103
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
Comments
I digged into this issue and it appears this stopped working when the alpha LRU cache was removed. In general, we cannot guarantee that the indices will work properly before the commit is finished as the data has not made it all the way to badger. The reason that exact works is that such a query is using the transaction cache. We do not anticipate to support something like this in the future so I'd recommend committing the mutations beforehand if you require indices to work properly. |
This is the exact PR where I stopped supporting inequality on uncommitted secondary indices. a2e8376
|
Does that mean I should expect |
Note that this only applies to uncommitted transaction updates on secondary indices. Exact and Hash index should work right now, but we make no guarantees whether their behavior would remain the same or change in the future. A read-modify-write cycle is the right way to approach a transaction, where you read the current state, generate your delta and then commit. |
This seems to be a regression from v1.0.11. A few of our tests started to fail after we switched to using v1.0.12 (docker image
dgraph/dgraph:latest
)If I add a
hash
-indexed string-typed predicate and try to query it later in the same transaction, I will not be able to find it. However, if the index type was set toexact
, the query after the mutation would be able to find the added predicate. Python script to reproduce below.Dgraph version : v1.0.12
Commit SHA-1 : 60d9ef0
Commit timestamp : 2019-03-05 17:59:30 -0800
Branch : HEAD
Go version : go1.11.5
Yes
Docker on Windows (one alpha and one zero on the same machine)
Actual (v1.0.12)
Expected (v1.0.11)
The text was updated successfully, but these errors were encountered: