wirelineio / wns

Wireline Naming Service
GNU General Public License v3.0
0 stars 1 forks source link

wnsd-lite returns different results for same query against a full node #275

Closed telackey closed 4 years ago

telackey commented 4 years ago

This query against my full node returns one entry:

  query {
    queryRecords(attributes: [ { key: "type", value: { string: "wrn:app" } }], all: false) {
      id
      names
      bondId
      createTime
      expiryTime
      owners
      attributes {
        key
        value {
          string
          json
        }
      }
    }
  }
{
  "data": {
    "queryRecords": [
      {
        "id": "bafyreiaxr34nzqrdmfoltbzc4iewvyvl4thwsxk4xd34qbqiurdiade7je",
        "names": [
          "wrn://dxos/application/console"
        ],
        "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
        "createTime": "2020-08-20T02:34:37.411174370",
        "expiryTime": "2021-08-20T02:34:37.411174370",
        "owners": [
          "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
        ],
        "attributes": [
          {
            "key": "version",
            "value": {
              "string": "0.0.13",
              "json": null
            }
          },
          {
            "key": "build",
            "value": {
              "string": "yarn dist",
              "json": null
            }
          },
          {
            "key": "displayName",
            "value": {
              "string": "Kubenet Console Client",
              "json": null
            }
          },
          {
            "key": "name",
            "value": {
              "string": "dxos.network/console-moon",
              "json": null
            }
          },
          {
            "key": "package",
            "value": {
              "string": null,
              "json": null
            }
          },
          {
            "key": "type",
            "value": {
              "string": "wrn:app",
              "json": null
            }
          }
        ]
      }
    ]
  }
}

Against my lite node (initialized from the same full node) it returns:

{
  "data": {
    "queryRecords": [
      {
        "id": "bafyreial66n4ijbrd6r7b6epra642ixij2ykfml6xthtepwv3zzvzulgeu",
        "names": [
          "wrn://dxos/application/console"
        ],
        "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
        "createTime": "2020-08-20T02:25:20.059492047",
        "expiryTime": "2021-08-20T02:25:20.059492047",
        "owners": [
          "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
        ],
        "attributes": [
          {
            "key": "build",
            "value": {
              "string": "yarn dist",
              "json": null
            }
          },
          {
            "key": "displayName",
            "value": {
              "string": "Kubenet Console Client",
              "json": null
            }
          },
          {
            "key": "name",
            "value": {
              "string": "dxos.network/console-moon",
              "json": null
            }
          },
          {
            "key": "package",
            "value": {
              "string": "Qme8aGPrvs6TzgeQGoDpGb46jpvg5pLb71Fg91YFBPgz5K",
              "json": null
            }
          },
          {
            "key": "type",
            "value": {
              "string": "wrn:app",
              "json": null
            }
          },
          {
            "key": "version",
            "value": {
              "string": "0.0.11",
              "json": null
            }
          }
        ]
      },
      {
        "id": "bafyreiaxr34nzqrdmfoltbzc4iewvyvl4thwsxk4xd34qbqiurdiade7je",
        "names": [
          "wrn://dxos/application/console"
        ],
        "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
        "createTime": "2020-08-20T02:34:37.411174370",
        "expiryTime": "2021-08-20T02:34:37.411174370",
        "owners": [
          "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
        ],
        "attributes": [
          {
            "key": "package",
            "value": {
              "string": null,
              "json": null
            }
          },
          {
            "key": "type",
            "value": {
              "string": "wrn:app",
              "json": null
            }
          },
          {
            "key": "version",
            "value": {
              "string": "0.0.13",
              "json": null
            }
          },
          {
            "key": "build",
            "value": {
              "string": "yarn dist",
              "json": null
            }
          },
          {
            "key": "displayName",
            "value": {
              "string": "Kubenet Console Client",
              "json": null
            }
          },
          {
            "key": "name",
            "value": {
              "string": "dxos.network/console-moon",
              "json": null
            }
          }
        ]
      },
      {
        "id": "bafyreibkvorvzlk3bttggtctr75gahhco2baalk2rzfdebsadfro5uueou",
        "names": [
          "wrn://dxos/application/console"
        ],
        "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
        "createTime": "2020-08-20T02:30:46.424953845",
        "expiryTime": "2021-08-20T02:30:46.424953845",
        "owners": [
          "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
        ],
        "attributes": [
          {
            "key": "name",
            "value": {
              "string": "dxos.network/console-moon",
              "json": null
            }
          },
          {
            "key": "package",
            "value": {
              "string": null,
              "json": null
            }
          },
          {
            "key": "type",
            "value": {
              "string": "wrn:app",
              "json": null
            }
          },
          {
            "key": "version",
            "value": {
              "string": "0.0.12",
              "json": null
            }
          },
          {
            "key": "build",
            "value": {
              "string": "yarn dist",
              "json": null
            }
          },
          {
            "key": "displayName",
            "value": {
              "string": "Kubenet Console Client",
              "json": null
            }
          }
        ]
      },
      {
        "id": "bafyreicmi6bubhobvuyml5tdqig6jkpaggiluo3mfslvriqa27sauww4z4",
        "names": [
          "wrn://dxos/application/console"
        ],
        "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
        "createTime": "2020-08-19T21:02:22.904376072",
        "expiryTime": "2021-08-19T21:02:22.904376072",
        "owners": [
          "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
        ],
        "attributes": [
          {
            "key": "version",
            "value": {
              "string": "0.0.9",
              "json": null
            }
          },
          {
            "key": "build",
            "value": {
              "string": "yarn dist",
              "json": null
            }
          },
          {
            "key": "displayName",
            "value": {
              "string": "Kubenet Console Client",
              "json": null
            }
          },
          {
            "key": "name",
            "value": {
              "string": "dxos.network/console-moon",
              "json": null
            }
          },
          {
            "key": "package",
            "value": {
              "string": null,
              "json": null
            }
          },
          {
            "key": "type",
            "value": {
              "string": "wrn:app",
              "json": null
            }
          }
        ]
      }
    ]
  }
}
telackey commented 4 years ago

In my case these are all versions of the same entry:

Screen Shot 2020-08-19 at 10 11 30 PM
telackey commented 4 years ago

I checked the md5sum of the binaries on both machines, and they are from the same build.

telackey commented 4 years ago

After resetting my lite node, it showed only the latest record. Publishing a new version of the record and setting the name to point to it brought back the issue.

After doing that it showed two versions of the record, .13 (the latest at reset) and .15 (the new one).

ashwinphatak commented 4 years ago

Should be fixed by https://github.com/wirelineio/wns/commit/618245705b3cff5cffdf2e354ee4525598a80a5f.

Thanks for the analysis, helped me narrow it down pretty quickly.