# Unexpected query results after restart

**URL:** https://discuss.dgraph.io/t/unexpected-query-results-after-restart/6835
**Category:** Dgraph
**Created:** [May 26, 2020, 10:54am UTC](https://discuss.dgraph.io/t/unexpected-query-results-after-restart/6835 "2020-05-26T10:54:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![khageman](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@khageman](https://discuss.dgraph.io/u/khageman)
#### Post date: [May 26, 2020, 10:54am UTC](https://discuss.dgraph.io/t/unexpected-query-results-after-restart/6835/1 "2020-05-26T10:54:24Z")

</div>

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:

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

```

with response

```auto
  "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?

---

<div class="post-metadata">

### Author: ![pawan](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/pawan/32/1946_2.png) [@pawan](https://discuss.dgraph.io/u/pawan)
#### Post date: [May 26, 2020, 4:05pm UTC](https://discuss.dgraph.io/t/unexpected-query-results-after-restart/6835/2 "2020-05-26T16:05:57Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![khageman](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@khageman](https://discuss.dgraph.io/u/khageman)
#### Post date: [May 27, 2020, 7:32am UTC](https://discuss.dgraph.io/t/unexpected-query-results-after-restart/6835/3 "2020-05-27T07:32:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![pawan](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/pawan/32/1946_2.png) [@pawan](https://discuss.dgraph.io/u/pawan)
#### Post date: [May 27, 2020, 7:36am UTC](https://discuss.dgraph.io/t/unexpected-query-results-after-restart/6835/4 "2020-05-27T07:36:53Z")

</div>

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](https://github.com/dgraph-io/dgraph/releases/tag/v20.03.0).
