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

Query reading by device name and resource name API returned incorrect totalCount value #3774

Closed
cherrycl opened this issue Oct 25, 2021 · 0 comments · Fixed by #3775
Closed
Assignees
Labels
bug Something isn't working jakarta
Milestone

Comments

@cherrycl
Copy link
Contributor

🐞 Bug Report

Affected Services

The issue is located in: Data

Is this a regression?

No

Description and Minimal Reproduction

  1. Create 1 event with 1 reading.
  2. Query reading by API http://localhost:59880/api/v2/reading/device/name/Device-Test-002/resourceName/Simple-Reading, got totalCount =1
  3. Delete the events and readings by API http://localhost:59880/api/v2/event/age/0.
  4. Repeat step1 again to create a new event and reading.
  5. Repeat step2 and find the incorrect totalCount.

Actual result: totalCount return 2
Expected: totolCount return 1

🔥 Exception or Error





🌍 Your Environment

Deployment Environment:

EdgeX Version: Jakarta

Anything else relevant?

@cherrycl cherrycl added the bug Something isn't working label Oct 25, 2021
judehung added a commit to judehung/edgex-go that referenced this issue Oct 25, 2021
…eName when deleting readings

When adding readings, a redis sorted set will be created as db index for
the relation of reading:deviceName:resourceName, and this index will be
used to query readings by deviceName and resourceName.

However, the current implementation doesn't remove such index when an
associated event is deleted, thus generating incorrect query result for
readings.

This commit fixes this bug by adding codes to remove db index of
reading:deviceName:resourceName while deleting readings.

closes edgexfoundry#3774

Signed-off-by: Jude Hung <[email protected]>
@lenny-goodell lenny-goodell added this to the Jakarta milestone Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jakarta
Projects
None yet
3 participants