The same query on different node got different result

Hi,I used Dgraph v1.2.1and the schema is


there is some data in dgraph

but, I found when I run query on different alpha node, I got different result, like this

and

the only difference between two picture is the ip, but the result is different too, it is a bug?

Is it possible to reproduce in a small context? if so, it is a bug.

yes, my cluster is 3 zero 9 alpha 3 replicas. I run the query on third node which is not in the same group with above nodes.and the result look like random.
first run


second run

third run

Sorry, I can’t reproduce it

{
    "counter": "17",
    "groups": {
        "1": {
            "members": {
                "1": {
                    "id": "1",
                    "groupId": 1,
                    "addr": "localhost:7080",
                    "leader": true,
                    "lastUpdate": "1584072317"
                },
                "2": {
                    "id": "2",
                    "groupId": 1,
                    "addr": "localhost:7081"
                },
                "3": {
                    "id": "3",
                    "groupId": 1,
                    "addr": "localhost:7082"
                }
            },
            "tablets": {
                "dgraph.graphql.schema": {
                    "groupId": 1,
                    "predicate": "dgraph.graphql.schema"
                },
                "dgraph.type": {
                    "groupId": 1,
                    "predicate": "dgraph.type"
                },
                "gid": {
                    "groupId": 1,
                    "predicate": "gid"
                },
                "label": {
                    "groupId": 1,
                    "predicate": "label"
                }
            },
            "checksum": "11670762211979891901"
        }
    },
    "zeros": {
        "1": {
            "id": "1",
            "addr": "localhost:5080",
            "leader": true
        },
        "2": {
            "id": "2",
            "addr": "localhost:5081"
        },
        "3": {
            "id": "3",
            "addr": "localhost:5082"
        }
    },
    "maxLeaseId": "10000",
    "maxTxnTs": "10000",
    "maxRaftId": "3",
    "cid": "5c473ad9-1ed9-4d47-bb0f-daa72be7e609",
    "license": {
        "maxNodes": "18446744073709551615",
        "expiryTs": "1586664306",
        "enabled": true
    }
}

The results are totally normal here.

Hi,you only have 1 group and 1replica?

It is not one replica. It is 3. Three replicas makes one group. If you have 3 Alphas. I’m doing this test with 3 Alphas. Just to not having to create a lot of terminal and so on. With 3 I can test the concept.

Now I have tested with 9 Alphas just to release of conscience
Same result.

{
    "counter": "25",
    "groups": {
        "1": {
            "members": {
                "1": {
                    "id": "1",
                    "groupId": 1,
                    "addr": "localhost:7081",
                    "leader": true,
                    "lastUpdate": "1584074470"
                },
                "2": {
                    "id": "2",
                    "groupId": 1,
                    "addr": "localhost:7082"
                },
                "3": {
                    "id": "3",
                    "groupId": 1,
                    "addr": "localhost:7083"
                }
            },
            "tablets": {
                "dgraph.graphql.schema": {
                    "groupId": 1,
                    "predicate": "dgraph.graphql.schema"
                },
                "dgraph.type": {
                    "groupId": 1,
                    "predicate": "dgraph.type"
                },
                "gid": {
                    "groupId": 1,
                    "predicate": "gid"
                },
                "label": {
                    "groupId": 1,
                    "predicate": "label"
                }
            },
            "checksum": "11670762211979891901"
        },
        "2": {
            "members": {
                "4": {
                    "id": "4",
                    "groupId": 2,
                    "addr": "localhost:7084",
                    "leader": true,
                    "lastUpdate": "1584074485"
                },
                "5": {
                    "id": "5",
                    "groupId": 2,
                    "addr": "localhost:7085"
                },
                "6": {
                    "id": "6",
                    "groupId": 2,
                    "addr": "localhost:7086"
                }
            },
            "checksum": "11160318154034397263"
        },
        "3": {
            "members": {
                "7": {
                    "id": "7",
                    "groupId": 3,
                    "addr": "localhost:7087",
                    "leader": true,
                    "lastUpdate": "1584074502"
                },
                "8": {
                    "id": "8",
                    "groupId": 3,
                    "addr": "localhost:7088"
                },
                "9": {
                    "id": "9",
                    "groupId": 3,
                    "addr": "localhost:7089"
                }
            },
            "checksum": "11160318154034397263"
        }
    },
    "zeros": {
        "1": {
            "id": "1",
            "addr": "localhost:5080",
            "leader": true
        },
        "2": {
            "id": "2",
            "addr": "localhost:5081"
        },
        "3": {
            "id": "3",
            "addr": "localhost:5082"
        }
    },
    "maxLeaseId": "10000",
    "maxTxnTs": "10000",
    "maxRaftId": "9",
    "cid": "6795de85-2182-43d7-a2bb-7899f17561ba",
    "license": {
        "maxNodes": "18446744073709551615",
        "expiryTs": "1586666466",
        "enabled": true
    }
}

Just to add info about what I did

{
   "set": [
      {
         "gid": "1",
         "label": "resblock"
      },
      {
         "gid": "2",
         "label": "resblock"
      },
      {
         "gid": "3",
         "label": "resblock"
      },
      {
         "gid": "4",
         "label": "resblock"
      },
      {
         "gid": "5",
         "label": "resblock"
      }
   ]
}

I’ve tested this query manually in all alphas.

{
  q(func: has(label), first:10){
    gid
    label
  }
}
dgraph zero --replicas 3 --my=localhost:5080 --idx 1
dgraph zero -o=1 --replicas=3 -w=./1 --peer=localhost:5080 --idx=2 --my=localhost:5081
dgraph zero -o=2 --replicas=3 -w=./2 --peer=localhost:5080 --idx=3 --my=localhost:5082
dgraph alpha --my=localhost:7081 --lru_mb=2048 --zero=localhost:5080 -p=./alpha_1 -w=alphawall_1 -o 1
dgraph alpha --my=localhost:7082 --lru_mb=2048 --zero=localhost:5080 -p=./alpha_2 -w=alphawall_2 -o 2
dgraph alpha --my=localhost:7083 --lru_mb=2048 --zero=localhost:5080 -p=./alpha_3 -w=alphawall_3 -o 3

dgraph alpha --my=localhost:7084 --lru_mb=2048 --zero=localhost:5080 -p=./alpha_4 -w=alphawall_4 -o 4
dgraph alpha --my=localhost:7085 --lru_mb=2048 --zero=localhost:5080 -p=./alpha_5 -w=alphawall_5 -o 5
dgraph alpha --my=localhost:7086 --lru_mb=2048 --zero=localhost:5080 -p=./alpha_6 -w=alphawall_6 -o 6

dgraph alpha --my=localhost:7087 --lru_mb=2048 --zero=localhost:5080 -p=./alpha_7 -w=alphawall_7 -o 7
dgraph alpha --my=localhost:7088 --lru_mb=2048 --zero=localhost:5080 -p=./alpha_8 -w=alphawall_8 -o 8
dgraph alpha --my=localhost:7089 --lru_mb=2048 --zero=localhost:5080 -p=./alpha_9 -w=alphawall_9 -o 9

ok,I will do in my env to recheck.thx

1 Like

Hi ,I had the same problem, but I don’t understand the solution “ok,I will do in my env to recheck.thx”,What does this sentence mean?Can you tell me how you solved it in the end?thanks

I think the poster meant they will try the same pattern with the dgraph zero and dgraph alpha commands posted by Michel.

it is my mistake. I used bulk loader by mistake.

@Willem520, I also used bulk loader, Can you tell me what is the mistake?

after bulk, you should copy the /p to all of alpha which is belong the same group. what I did is copy to one alpha.so I got the error.

@ Willem520, thanks