Potential bug with filters when func is too long?


Report a Dgraph Bug

What version of Dgraph are you using?

v20.07.02

Have you tried reproducing the issue with the latest release?

Yes

What is the hardware spec (RAM, OS)?

Running dev instance on MacBook Pro 15-inch 2018

Steps to reproduce the issue (command/config used to run Dgraph).

When I run a query with a big eq plus a filter, like this:

    all(func: eq(cms_xid, ["BLC0000002772","BLC0000001510","BLC0000000934","BLC0000002332","BLC0000000071","BLC0000002370","BLC0000003307","BLC0000002354","BLC0000002476","BLC0000000009","BLC0000002590","BLC0000003107","BLC0000003096","BLC0000002889","BLC0000002911","BLC0000000991","BLC0000001407","BLC0000002273","BLC0000002415","BLC0000003058","BLC0000000094","BLC0000003345","BLC0000000725","BLC0000003391","BLC0000002832","BLC0000000465","BLC0000002556","BLC0000001888","BLC0000003165","BLC0000003277","BLC0000002800","BLC0000002465","BLC0000000276","BLC0000001684","BLC0000002929","BLC0000002081","BLC0000001382","BLC0000000907","BLC0000003408","BLC0000000399","BLC0000002487","BLC0000002396","BLC0000003310","BLC0000002341","BLC0000002032","BLC0000002741","BLC0000001952","BLC0000000461","BLC0000001834","BLC0000001149","BLC0000003119","BLC0000003327","BLC0000003077","BLC0000001032","BLC0000002708","BLC0000000371","BLC0000000099","BLC0000001818","BLC0000000002","BLC0000000845","BLC0000000398","BLC0000003385","BLC0000000039","BLC0000001951","BLC0000002426","BLC0000002474","BLC0000002482","BLC0000002857","BLC0000002886","BLC0000000628","BLC0000001274","BLC0000003061","BLC0000003137","BLC0000000462","BLC0000001183","BLC0000002831","BLC0000002898","BLC0000001157","BLC0000002486","BLC0000002439","BLC0000000105","BLC0000000142","BLC0000003121","BLC0000000036","BLC0000001260","BLC0000002409","BLC0000001273","BLC0000003144","BLC0000000035","BLC0000002126","BLC0000002601","BLC0000001387","BLC0000001423","BLC0000002616","BLC0000002542","BLC0000003223","BLC0000001828","BLC0000002152","BLC0000001939","BLC0000003392","BLC0000000333","BLC0000002369","BLC0000003282","BLC0000002585","BLC0000003219","BLC0000001330","BLC0000001099","BLC0000002097","BLC0000000559","BLC0000002402","BLC0000002077","BLC0000000323","BLC0000003177","BLC0000001502","BLC0000003028","BLC0000002776","BLC0000002229","BLC0000001823","BLC0000003244","BLC0000002417","BLC0000003227","BLC0000003308","BLC0000000089","BLC0000002157","BLC0000000424","BLC0000000979","BLC0000002457","BLC0000000233","BLC0000003103","BLC0000003146","BLC0000001801","BLC0000000661","BLC0000001689","BLC0000002201","BLC0000002432","BLC0000000196","BLC0000000302","BLC0000002438","BLC0000000316","BLC0000002412","BLC0000003341","BLC0000002016","BLC0000001691","BLC0000002107","BLC0000000626","BLC0000001083","BLC0000002529","BLC0000002984","BLC0000003195","BLC0000001358","BLC0000000356","BLC0000001673","BLC0000000459","BLC0000000947","BLC0000003074","BLC0000003182","BLC0000001947","BLC0000000540","BLC0000002711","BLC0000000061","BLC0000003238","BLC0000001747","BLC0000002687","BLC0000003141","BLC0000003224","BLC0000002792","BLC0000000397","BLC0000002259","BLC0000003154","BLC0000002804","BLC0000000526","BLC0000003242","BLC0000002296","BLC0000002045","BLC0000000359","BLC0000002161","BLC0000002171","BLC0000002538","BLC0000003181","BLC0000003360","BLC0000003216","BLC0000002515","BLC0000000342","BLC0000003226","BLC0000000509","BLC0000001019","BLC0000002371","BLC0000002471","BLC0000002536","BLC0000001971","BLC0000001228","BLC0000003402","BLC0000002368","BLC0000000114","BLC0000003355","BLC0000003303","BLC0000001913","BLC0000002833","BLC0000000164","BLC0000003059","BLC0000002544","BLC0000001711","BLC0000002295","BLC0000000225","BLC0000001384","BLC0000002060","BLC0000000882","BLC0000003361","BLC0000001732","BLC0000001084","BLC0000002228","BLC0000003393","BLC0000000357","BLC0000003213","BLC0000003075","BLC0000001683","BLC0000002890","BLC0000000437","BLC0000002677","BLC0000000777","BLC0000001693","BLC0000000245","BLC0000002125","BLC0000003080","BLC0000002822","BLC0000002330","BLC0000000086","BLC0000003318","BLC0000000644","BLC0000002836","BLC0000001892","BLC0000001721","BLC0000003034","BLC0000003305","BLC0000000775","BLC0000003003","BLC0000003302","BLC0000001619","BLC0000002738","BLC0000000760","BLC0000000478","BLC0000001830","BLC0000002042","BLC0000001991","BLC0000002398","BLC0000002414","BLC0000003236","BLC0000000429","BLC0000001924","BLC0000003397","BLC0000001033","BLC0000000095","BLC0000003311","BLC0000002040","BLC0000003170","BLC0000001898","BLC0000002712","BLC0000003117","BLC0000002718","BLC0000002827","BLC0000003057","BLC0000003362","BLC0000002000","BLC0000002949","BLC0000000068","BLC0000003056","BLC0000002948","BLC0000002493","BLC0000000722","BLC0000003293","BLC0000001644","BLC0000000090","BLC0000000520","BLC0000002364","BLC0000002431","BLC0000002348","BLC0000001842","BLC0000002328","BLC0000001997","BLC0000000386","BLC0000003378","BLC0000000215","BLC0000003374","BLC0000000888","BLC0000001333","BLC0000000627","BLC0000002777","BLC0000003356","BLC0000000436","BLC0000000615","BLC0000002938","BLC0000000405","BLC0000001313","BLC0000001769","BLC0000000549","BLC0000001658","BLC0000002678","BLC0000003255","BLC0000002652","BLC0000000138","BLC0000000752","BLC0000002240","BLC0000003349","BLC0000002707","BLC0000000650","BLC0000002399","BLC0000003188","BLC0000002665","BLC0000002587","BLC0000003363","BLC0000000927","BLC0000002220","BLC0000002790","BLC0000000887","BLC0000001923","BLC0000002874","BLC0000000696","BLC0000001631","BLC0000001321","BLC0000003256","BLC0000000101","BLC0000000448","BLC0000003406","BLC0000002980","BLC0000000338","BLC0000000112","BLC0000003190","BLC0000002871","BLC0000000033","BLC0000001806","BLC0000002378","BLC0000002958","BLC0000003396","BLC0000003400","BLC0000002128","BLC0000002236","BLC0000001580","BLC0000002067","BLC0000002933","BLC0000002130","BLC0000003370","BLC0000001589","BLC0000000277","BLC0000003383","BLC0000001142","BLC0000002798","BLC0000000499","BLC0000001968","BLC0000001359","BLC0000000820","BLC0000003234","BLC0000000964","BLC0000000358","BLC0000002675","BLC0000002521","BLC0000003106","BLC0000000555","BLC0000003306","BLC0000001405","BLC0000003353","BLC0000003357","BLC0000003369","BLC0000003386","BLC0000000515","BLC0000003409","BLC0000000519","BLC0000002213","BLC0000002297","BLC0000002668","BLC0000000605","BLC0000002783","BLC0000001741","BLC0000001617","BLC0000000426","BLC0000002440","BLC0000001620","BLC0000002260","BLC0000002395","BLC0000002009","BLC0000002413","BLC0000001422","BLC0000002363","BLC0000002553","BLC0000000186","BLC0000000031","BLC0000002519","BLC0000002621","BLC0000002374","BLC0000000521","BLC0000000219","BLC0000000191","BLC0000001959","BLC0000002383","BLC0000003072","BLC0000000408","BLC0000000380","BLC0000001196","BLC0000000286","BLC0000001289","BLC0000001364","BLC0000000019","BLC0000000441","BLC0000003389","BLC0000000047","BLC0000001210","BLC0000002387","BLC0000003081","BLC0000002537","BLC0000003090","BLC0000000562","BLC0000001000","BLC0000002989","BLC0000002837","BLC0000002419","BLC0000002932","BLC0000001248","BLC0000002723","BLC0000002653","BLC0000000431","BLC0000000761","BLC0000000469","BLC0000002319","BLC0000003225","BLC0000000309","BLC0000003390","BLC0000002791","BLC0000000632","BLC0000001928","BLC0000000734","BLC0000002488","BLC0000002660","BLC0000002555","BLC0000001533","BLC0000002747","BLC0000003384","BLC0000002943","BLC0000002416","BLC0000001410","BLC0000003151","BLC0000002422","BLC0000002802","BLC0000001245","BLC0000000021","BLC0000000468","BLC0000002581","BLC0000001034","BLC0000003116","BLC0000002528","BLC0000002214","BLC0000002425","BLC0000001365","BLC0000001728","BLC0000000382","BLC0000001861","BLC0000002375","BLC0000003249","BLC0000000059","BLC0000003251","BLC0000002710","BLC0000001205","BLC0000001921","BLC0000002472","BLC0000002507","BLC0000000655","BLC0000002649","BLC0000000502","BLC0000001704","BLC0000000172","BLC0000000864","BLC0000000223","BLC0000001208","BLC0000002142","BLC0000001540","BLC0000002234","BLC0000000673","BLC0000003412","BLC0000002095","BLC0000002596","BLC0000002269","BLC0000000134","BLC0000000377","BLC0000000631","BLC0000000107","BLC0000000395","BLC0000002576","BLC0000001727","BLC0000002449","BLC0000001164","BLC0000000361","BLC0000003395","BLC0000002455","BLC0000001434","BLC0000002775","BLC0000002658","BLC0000003257","BLC0000002278","BLC0000000443","BLC0000002504","BLC0000001868","BLC0000002977","BLC0000002977"])) @filter(type(PublisherLabel))
      {
        uid
        xid
        cms_xid
        visible
        popularity
        publisher_label.name@ja
        dgraph.type
      }
    }

This causes dgraph to return 0 results even though every single node that meets the eq is like this:

{
  "data": {
    "all": [
      {
        "uid": "0x2c078d",
        "xid": "BwMbB6a2ogA",
        "cms_xid": "BLC0000000356",
        "visible": true,
        "popularity": 0.2,
        "publisher_label.name@ja": "ジャンプコミックスDIGITAL",
        "dgraph.type": [
          "PublisherLabel"
        ]
      },
      {
        "uid": "0x2c078e",
        "xid": "BwMgB6a2ogA",
        "cms_xid": "BLC0000000361",
        "visible": true,
        "popularity": 0.0007,
        "publisher_label.name@ja": "集英社文庫",
        "dgraph.type": [
          "PublisherLabel"
        ]
      },
and so on...

The expected result is for all of the nodes to be returned.

In addition, this issue only seems to appear when my eq function has 500+ elements in it. When I cut it down to 499, everything once again works as expected. I am baffled.

Oops, I just realized my local version was running the wrong version of dgraph. Correcting to the latest version fixes the issue. Please close this.