-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
area/indexesRelated to indexes (indices) and their usage.Related to indexes (indices) and their usage.kind/bugSomething is broken.Something is broken.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.
Description
What version of Dgraph are you using?
dgraph/dgraph:v20.07.0-beta.Jun22
Have you tried reproducing the issue with the latest release?
v20.07.0-beta.Jun22, and on master from 3 weeks ago
What is the hardware spec (RAM, OS)?
docker
Steps to reproduce the issue (command/config used to run Dgraph).
When overwriting the uid predicate, reverse index is not updated:
Schema string:
<edge>: uid @reverse .
First:
{
set {
<_:a> <name> "A" .
<_:a> <edge> <_:parent> .
<_:parent> <name> "Parent" .
}
}
Then:
upsert {
query {
U as var(func: has(edge))
}
mutation {
set {
uid(U) <edge> <_:parent2> .
<_:parent2> <name> "Parent2" .
}
}
}
Then run query to see results:
{
q(func: has(edge)) {
uid
name
edge {
name
}
}
q2(func: has(~edge)) {
name
~edge {
uid
name
}
}
}
Expected behaviour and actual result.
q query has correct values, but q2, which shows reverse edges, has even edges that do not exist.
"data": {
"q": [
{
"uid": "0x9c4e",
"name": "A",
"edge": {
"name": "Parent2" # one node, as expected
}
}
],
"q2": [
{
"name": "Parent",
"~edge": [ # this reverse edge does not exist.
{
"uid": "0x9c4e",
"name": "A"
}
]
},
{
"name": "Parent2",
"~edge": [
{
"uid": "0x9c4e",
"name": "A"
}
]
}
]
},
Reindexing fixes the issue.
Metadata
Metadata
Assignees
Labels
area/indexesRelated to indexes (indices) and their usage.Related to indexes (indices) and their usage.kind/bugSomething is broken.Something is broken.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.