What version of Dgraph are you using?
Doesn’t work: 20.03.4-rc2 and 20.07.0-rc1
Works: 20.03.3
What is the hardware spec (RAM, OS)?
Linux Debian Stable 16Go RAM
Steps to reproduce the issue (command/config used to run Dgraph).
Edit: The bug is different than described here, details in this post.
Remove an edge having @reverse and @count indexes (not sure @count is involved with the issue).
Expected behaviour and actual result.
Expected: Edge is removed both ways.
Actual: Normal edge is still present, reverse edge has been removed.
Schema extract :
type Game {
[some fields...]
}
type Answer {
game_answer
}
game_answer: uid @reverse @count .
Json delete:
[{"uid":"0x8d569","game_answer":{"uid":"0x8d35f"}}]
A query proves the incoherent state :
{
Answers(func: type(Answer)) @filter(gt(count(game_answer), 1)) {
uid
games as game_answer {
uid
}
}
Games(func: uid(games)) {
uid
~game_answer {
uid
game_answer { uid }
}
}
}
Response :
{
"data": {
"Answers": [
{
"uid": "0x8d569",
"game_answer": {
"uid": [
"0x8d35f",
"0x8d6e0"
]
}
}
],
"Games": [
{
"uid": "0x8d35f",
"~game_answer": [
{
"uid": "0x8d360",
"game_answer": {
"uid": "0x8d35f"
}
},
{
"uid": "0x8d9f4",
"game_answer": {
"uid": "0x8d35f"
}
}
]
},
{
"uid": "0x8d6e0",
"~game_answer": [
{
"uid": "0x8d569",
"game_answer": {
"uid": [
"0x8d35f",
"0x8d6e0"
]
}
},
{
"uid": "0x8d6e1",
"game_answer": {
"uid": "0x8d6e0"
}
}
]
}
]
}
}
As you can see, answer 0x8d569
points to 0x8d35f
but the reverse edge is not present.
Only the reverse edge has been removed.
More over, game_answer is of type uid
and thus should not contain a list.