From the v1.0.9 or later version of Dgraph returns unexpected results when use has clause with reverse edge

Hello,
I noticed that latest version of Dgraph (I tried to use v1.0.9 and v1.0.10-rc1) returns entity having non-reversed when use has(~edge).
Is this behavior is correct?

For example, define the following schema and data.

schema

name: string @index(hash) .
follow: uid @count @reverse .

data

{
  set {
    _:alice <name> "alice" .
    _:bob <name> "bob" .
    _:carol <name> "carol" .
    _:alice <follow> _:carol .
    _:bob <follow> _:carol .
  }
}

And execute below.

{
  q(func: has(~follow)) {
    name
  }
}

Before v1.0.9 returns carol.

{
  "data": {
    "q": [
      {
        "name": "carol",
        "uid": "0x6b"
      }
    ]
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 25300,
      "processing_ns": 3185500,
      "encoding_ns": 1790700
    },
    "txn": {
      "start_ts": 533,
      "lin_read": {
        "ids": {
          "1": 689
        }
      }
    }
  }
}

But v1.0.9 or later version returns alice and bob

{
  "data": {
    "q": [
      {
        "name": "alice",
        "uid": "0x7"
      },
      {
        "name": "bob",
        "uid": "0x8"
      }
    ]
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 196900,
      "processing_ns": 3609300,
      "encoding_ns": 1054700
    },
    "txn": {
      "start_ts": 51
    }
  }
}

Yeah, we were suspicious that something had happened to that. But now with your alert we are sure. The modifications will be undone in this regard. Thanks for noticing! Next RC or Release will be fixed.

Cheers.

1 Like

please do work out a test case for this, kind of scary

Don’t worry check the commit
https://github.com/dgraph-io/dgraph/commit/901cb2588cb6af57fdb8009af54cbb42642f0ef4

nice :slight_smile: thats fast fix

good job! thank you for your quick response :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.