【问题标题】:fiware NGSI-LD orion-ld context broker didn't send all entities for a type as expectedfiware NGSI-LD orion-ld 上下文代理未按预期发送类型的所有实体
【发布时间】:2022-01-20 21:38:56
【问题描述】:

我用大约 90.000 个地址(ID 类似于“urn:ngsi-ld:address:Testtown:12345:Haus-Knipp-Str:15”)填充了一个 fiware orion-ld。 如果我通过 url 从 orion-ld 代理读取所有类型为“地址”的实体(使用偏移设置,逐步限制为 1000),例如“http://{{orion}}/ngsi-ld/v1/entities?type=Address&offset=0&limit=1000”,我随时都会收到来自 orion-ld 的预期答案,直到我尝试请求 “http://{{orion}}/ngsi-ld/v1/entities?type=Address&offset=25000&limit=1000”。 然后意外的答案是“[]”。它应该填充 1000 个实体。

如果我按 1000 个实体逐步删除类型为“地址”的所有实体(每次我请求前 1000 个实体并随后删除它们),我可以删除 >98000 个实体。所以所有 98000 个实体都在 orion-ld 中。但我无法从 orion-ld 读取所有实体。

我尝试找出最后一个可读实体,它是“http://{{orion}}/ngsi-ld/v1/entities?type=Address&offset=25248&limit=1”,下一个请求失败:“http://{{orion}}/ngsi-ld/v1/entities?type=Address&offset=25249&limit=1”如果我尝试获取高于 25248 的实体,它完全失败了。

如果我检查,如果“地址”类型的所有 98000 个 ID 都在 orion-ld 中,我会通过 url “http://{{orion}}/ngsi-ld/v1/entities/{{id}}”请求它们。我收到每个 ID 的预期答案。所以所有的 ID 都在 orion-ld 中。只有读请求失败,从offset>25248开始。

orion-ld 是否有错误,或者阈值未知,需要换一种方式处理?


今天我创建了 100,000 个“TestTestTest”类型的实体,例如:

{
    "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld",
    "id": "TestTestTest:20000",
    "type": "TestTestTest",
    "name": {
        "type": "Property",
        "value": 20000
    }
},

如果我再次尝试读取所有类型为“TestTestTest”的实体,我发现了另一个阈值:87637

read all entities for type TestTestTest with offset=86000 and limit=1000 --> successfull: read 1000 values
read all entities for type TestTestTest with offset=87000 and limit=1000 --> error: read 0 values
read all entities for type TestTestTest with offset=87000 and limit=500 --> successfull: read 500 values
read all entities for type TestTestTest with offset=87500 and limit=500 --> error: read 0 values
read all entities for type TestTestTest with offset=87500 and limit=250 --> error: read 0 values
read all entities for type TestTestTest with offset=87500 and limit=125 --> successfull: read 125 values
read all entities for type TestTestTest with offset=87625 and limit=125 --> error: read 0 values
read all entities for type TestTestTest with offset=87625 and limit=62 --> error: read 0 values
read all entities for type TestTestTest with offset=87625 and limit=31 --> error: read 0 values
read all entities for type TestTestTest with offset=87625 and limit=15 --> error: read 0 values
read all entities for type TestTestTest with offset=87625 and limit=7 --> successfull: read 7 values
read all entities for type TestTestTest with offset=87632 and limit=7 --> error: read 0 values
read all entities for type TestTestTest with offset=87632 and limit=3 --> successfull: read 3 values
read all entities for type TestTestTest with offset=87635 and limit=3 --> successfull: read 3 values
read all entities for type TestTestTest with offset=87638 and limit=3 --> error: read 0 values
read all entities for type TestTestTest with offset=87638 and limit=1 --> error: read 0 values
try to read the last readable entity with type TestTestTest with offset=87637 and limit=1 --> id=TestTestTest:87637
try to read an entity after the last readable entity with type TestTestTest with offset=87638 and limit=1 --> []
ERROR, the requested amount of entities (iOffset=87637) seems not the expected count.

我在 docker 环境中使用以下版本的 orion-ld:

{
    "orionld version": "post-v0.8.1",
    "orion version": "1.15.0-next",
    "uptime": "7 d, 12 h, 2 m, 55 s",
    "git_hash": "nogitversion",
    "compile_time": "Wed Dec 15 15:12:50 UTC 2021",
    "compiled_by": "root",
    "compiled_in": "",
    "release_date": "Wed Dec 15 15:12:50 UTC 2021",
    "doc": "https://fiware-orion.readthedocs.org/en/master/"
}

如果您能在这种情况下提供帮助,那就太好了。 谢谢,克尼格

【问题讨论】:

    标签: get entities


    【解决方案1】:

    是的,这似乎确实是 Orion-LD 中的一个错误。 作为一个错误,我们需要它作为 github repo 上的一个问题。 你能提出问题....here 吗? (这样你就会被告知更新)

    【讨论】:

      【解决方案2】:

      所以,我用 27000 个实体填充了我的数据库并进行了测试:

      ldcurl GET "/entities?type=T&offset=26000&count=true&limit=1000"
      

      (ldcurl 是我的一个小脚本,它添加了主机、端口、accept-header 等)

      我没有问题,得到了偏移量为 26000 的示例测试的输出

      HTTP/1.1 200 OK
      Connection: Keep-Alive
      Content-Length: 138003
      Content-Type: application/json
      Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
      NGSILD-Results-Count: 27000
      Date: Thu, 27 Jan 2022 19:31:14 GMT
      
      
      [
        {
          "id": "urn:ngsi-ld:entities:E26001",
          "type": "T",
          "A1": {
            "type": "Property",
            "value": "E26002:A1"
          }
        },
        {
          "id": "urn:ngsi-ld:entities:E26002",
          "type": "T",
          "A1": {
            "type": "Property",
            "value": "E26003:A1"
          }
        },
        ...
      

      我使用 develop 分支中的当前内容以及 release/1.0.0 中的内容进行了测试。

      在 Skype 上查找我,与 SOF 中的用户名相同,也许我们可以一起查看您的问题,因为我自己似乎无法重现它。

      同时,我会让我的实体与你的更相似,看看我是否有更多的运气。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多