# Should DROP\_ALL remove predicates from tablets

**URL:** <https://discuss.dgraph.io/t/should-drop-all-remove-predicates-from-tablets/9523>\
**Category:** Dgraph\
**Tags:** status:accepted, kind:bug, ticket:created\
**Created:** [August 18, 2020, 1:15pm UTC](https://discuss.dgraph.io/t/should-drop-all-remove-predicates-from-tablets/9523 "2020-08-18T13:15:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EnricoMi](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@EnricoMi](https://discuss.dgraph.io/u/EnricoMi)\
**Post date:** [August 18, 2020, 1:15pm UTC](https://discuss.dgraph.io/t/should-drop-all-remove-predicates-from-tablets/9523/1 "2020-08-18T13:15:27Z")

</div>

When I `DROP_ALL` data and schema from my Dgraph cluster, all predicates still exist in the `/state` endpoint under `/groups/*/tablets`. Is this expected or should / could them be removed from the partitioning as well since none of the predicates exist on any alpha node anymore.

What I do:

```
> curl -X POST localhost:8080/alter -d '{"drop_all": true}'
{"data":{"code":"Success","message":"Done"}}

> curl -o - http://localhost:8080/state | python -m json.tool
{
    …
    "groups": {
        "1": {
            …
            "tablets": {
                "dgraph.graphql.schema": …,
                "dgraph.graphql.xid": …,
                "dgraph.type": …,
                [all the predicates that just got dropped]
            }
        }
    },
    …
}
```

---

<div class="post-metadata">

**Author:** ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)\
**Post date:** [August 18, 2020, 2:06pm UTC](https://discuss.dgraph.io/t/should-drop-all-remove-predicates-from-tablets/9523/2 "2020-08-18T14:06:07Z")

</div>

Out of curiosity, what happens if you write new data into the DB?

---

<div class="post-metadata">

**Author:** ![abhimanyusinghgaur](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/abhimanyusinghgaur/32/2980_2.png) [@abhimanyusinghgaur](https://discuss.dgraph.io/u/abhimanyusinghgaur)\
**Post date:** [August 18, 2020, 4:35pm UTC](https://discuss.dgraph.io/t/should-drop-all-remove-predicates-from-tablets/9523/3 "2020-08-18T16:35:39Z")

</div>

I guess, `/state` uses in-memory cache for reporting the state, which is not being cleared after `DROP_ALL`.  
I think it should be cleared.  
Marking it as a bug.

Thanks @EnricoMi

---

<div class="post-metadata">

**Author:** ![EnricoMi](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@EnricoMi](https://discuss.dgraph.io/u/EnricoMi)\
**Post date:** [August 19, 2020, 6:21pm UTC](https://discuss.dgraph.io/t/should-drop-all-remove-predicates-from-tablets/9523/4 "2020-08-19T18:21:56Z")

</div>

Neither adding some data nor adding some schema removes any non-existing predicates from `/state`.

---

<div class="post-metadata">

**Author:** ![EnricoMi](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@EnricoMi](https://discuss.dgraph.io/u/EnricoMi)\
**Post date:** [August 19, 2020, 6:22pm UTC](https://discuss.dgraph.io/t/should-drop-all-remove-predicates-from-tablets/9523/5 "2020-08-19T18:22:28Z")

</div>

Thanks for confirming this as a bug.
