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

Handle entity duplicates in Mobile radio tracker #923

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kurotych
Copy link
Member

@kurotych kurotych commented Dec 19, 2024

During development testing, we encountered the following issue:

ERROR mobile_config::mobile_radio_tracker: error in tracking changes to mobile radios err=error returned from database: ON CONFLICT DO UPDATE command cannot affect row a second time

The root cause of this problem is the existence of duplicate entity keys in the key_to_assets table (on the dev server).

Solution: Handle (entity_key, asset) duplicates by fetching unique entries with the newer refreshed_at.

(Theoretically possible) Case where one entity_key maps to several different assets will still result in the error described above. Since I don't see a graceful recovery from such data corruption.

@kurotych kurotych marked this pull request as ready for review December 19, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant