Unexpected query results after restart

Hi all,

I am experiencing an issue with dgraph after restarting in Docker (one zero and alpha instance). I mounted a volume, so the database should be persistent (and previous restarts worked correctly).
I was using the latest docker image before (so I am not entirely sure which version I was running before) but since I pulled the latest version (v20.3.1) things have stopped working correctly.
I restarted dgraph after having some out-of-memory issues before hand, so I have done some tinkering here and there with the dgraph LRU settings/docker memory settings.

The query below gives some surprising results:

{
  nodeCount(func: has(address)) {
    nodeCount: count(uid)    
  }
  address(func: has(address), first: 1) {
    uid
    address
  }
  by_uid(func: uid(0x1ffa35)) {
    expand(_all_)
  }
}

with response

  "data": {
    "nodeCount": [
      {
        "nodeCount": 33820
      }
    ],
    "address": [
      {
        "uid": "0x1ffa35"
      }
    ],
    "by_uid": []
  }

So even though there should be nodes with an address property, querying for the property doesn’t return it. Also, there should be millions of addresses in the db (inserted before the dgraph restarting situation), way more than the 33k it returns now.

Does anyone have a suggestion how to tackle this problem?

Hey @khageman

Looks like you upgraded your version of Dgraph. Could you check from your logs which version were you using before? Also do you have a recent export or backup which you could check and see if you have all of your data there. Upgrading Dgraph shouldn’t show you partial results.

Thanks @pawan, I tracked down the version of dgraph I was running before and reverted to this version (v.1.2.2). This seems to have solved the issue describe above.

That explains it, v20.3.x would require an export and re-import if you are upgrading from v1.2.x series as mentioned at Release Dgraph v20.03.0 · dgraph-io/dgraph · GitHub.