Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination not working properly? #1647

Closed
glikson opened this issue Jan 8, 2016 · 5 comments
Closed

Pagination not working properly? #1647

glikson opened this issue Jan 8, 2016 · 5 comments
Labels
Milestone

Comments

@glikson
Copy link

glikson commented Jan 8, 2016

I am experiencing a strange behavior of Orion in FIWARE Lab. Between two queries with the only difference being the entity type ("santander:device" versus "bikerenting"), one is working properly, and the other is ignoring "limit" (probably also "offset") and returning "Count: 0" in details. The queries are:

echo '{"entities": [{"type":"santander:device","isPattern":"true","id": ".*"}],"attributes":[]}' | curl -X POST orion.lab.fiware.org:1026/v1/queryContext?limit=1&offset=0&details=on -s -S
--header 'Content-Type: application/json' --header 'Accept: application/json' --header "X-Auth-Token: $AUTH_TOKEN" -d @- | python -mjson.tool

echo '{"entities": [{"type":"bikerenting","isPattern":"true","id": ".*"}],"attributes":[]}' | curl -X POST orion.lab.fiware.org:1026/v1/queryContext?limit=1&offset=0&details=on -s -S
--header 'Content-Type: application/json' --header 'Accept: application/json' --header "X-Auth-Token: $AUTH_TOKEN" -d @- | python -mjson.tool

Here are the version details:
$ curl -X GET orion.lab.fiware.org:1026/version -s -S --header "X-Auth-Token: $AUTH_TOKEN"

    <orion>
      <version>0.26.1</version>
      <uptime>24 d, 20 h, 21 m, 34 s</uptime>
      <git_hash>93376583fbb6c8dd68b80b5bac436bf03f7d8358</git_hash>
      <compile_time>Wed Dec 9 11:45:27 CET 2015</compile_time>
      <compiled_by>fermin</compiled_by>
      <compiled_in>centollo</compiled_in>
    </orion>
@fgalan
Copy link
Member

fgalan commented Jan 8, 2016

This behaviour is due to Context Provider (CPr) forwarding. Note that in the case of "santander:device" all the information is local to CB, while in the case of "bikerting", there is no local information and all is retrieved from a CPr.

> db.entities.count({"_id.type": "santander:device"})
1203
> db.entities.count({"_id.type": "bikerenting"})
0
> db.registrations.count({"contextRegistration.entities.type": "bikerenting"})
4
> db.registrations.count({"contextRegistration.entities.type": "santander:device"})
0

Mixing pagination with CPr has some problems which solution is not clear (have a look to the "root" issue on pagination with CPr: #847). As you can see, currently there are two ideas on the table (any other suggestion? ;) but it is not clear which one to adopt at the end (both involve extra cost).

@fgalan
Copy link
Member

fgalan commented Jan 8, 2016

The present issue could be considered as a "child" of #847, i.e. once #847 got solved, the present issue will probably solved.

@glikson
Copy link
Author

glikson commented Jan 8, 2016

Thanks. So, how can I retrieve data associated with such a query? Is there some sort of workaround? E.g., can I retrieve details about the CPr and access it directly? Moreover, a subscription that I registered for bikerenting doesn't seem to be working either. Is it because of the same issue?

@fgalan
Copy link
Member

fgalan commented Jan 11, 2016

The workaround is to use the same queries, but assuming that the pagination parameters will be ignored. Actually, the second query you mentions works ok (returning 22 entities, at the moment of writting this).

Regarding subscripitions, CB doesn't know when informatino change in CPr (and pooling them for changes is not efficient). Thus, by the moment onchange subscriptions work only with entities that are local to the CB.

@fgalan
Copy link
Member

fgalan commented Jun 9, 2023

The present issue could be considered as a "child" of #847, i.e. once #847 got solved, the present issue will probably solved.

Based on this, as issue #847 was closed by PR #4149 we are going to close this issue. If we are wrong and it is still not working, please tell us about it (with the detailed steps to reproduce the problem), please.

@fgalan fgalan closed this as completed Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants