bug(nodes): duplicate ObservedNode rows from a non-atomic get-then-create
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
Línea de trabajo
Start by reading packets/services/base.py and packets/receivers.py, where the issue identifies the non-atomic get-then-create. Then inspect the models and migrations to map the Meshtastic node number, unique constraint, and foreign keys that the dedupe must preserve; review the 2.2.0 migration for its fail-closed and dry-run approach. Done means preventing concurrent duplicates, safely merging existing rows before adding the partial unique index, and naming the node in the remaining error response.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
Some Meshtastic node numbers have two or more ObservedNode rows. In pre-prod there are 38 duplicate pairs, and the prod identity backfill on 2026-11-04 reported 8 duplicate rows.
Cause (confirmed by a verifier): the node is created with a non-atomic get-then-create in packets/services/base.py and packets/receivers.py. Two packets from a new node, ingested within milliseconds of each other (0–8 ms apart in the pre-prod pairs), both miss the get and both create a row.
Effects:
- Packet uploads that then look the node up hit
MultipleObjectsReturnedand return 500. The pre-prod bot log had 6 of these on 2026-11-04, and the 400 they produce doesn't name the node. - Ghost rows keep a synthesised
Unknown Node !xxxxxxxxname while the real row has the node's name, so search and the UI can show two nodes. - NodeDB upserts touch
.first(), so it's unpredictable which row they update.
Expected
- Prevent it: make the create atomic, with
get_or_createbacked by a unique constraint and a retry onIntegrityError. - Constraint: add a unique (partial) index on the Meshtastic node number, for example
meshtastic_node_idwhere the protocol is Meshtastic. - Clean up existing rows: a data migration or management command that merges each duplicate set into one row: the one with the most history, or the oldest. It re-points every FK (packets, observations, positions, telemetry, claims, watches, and so on), keeps the best name, and deletes the extras. It needs a
--dry-run, and should run before the unique index is added. - Error message: the remaining 500/400 should name the node.
Notes
- This predates the Meshtastic 2.8 work. The rows date from before 2026-11.
- The dedupe has to run in prod, so it needs the same care as the 2.2.0 migration: fail closed, dry-run first.
- Related: #436 (ingest correctness review), #437 (2.8: identity linking will need one row per node number).
- Lenguaje dominante
- Python
- Estrellas
- 1
- Forks
- 0
- Merge medio
- 23 h 9 min
- PR fusionados (30 d)
- 15
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pskillen/meshflow-api
-
enhancement meshtastic-2.8
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
pskillen/meshflow-api#459 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 Medio día Aptitud para principiantes 55/100
pskillen/meshflow-api#479 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
pskillen/meshflow-api#478 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 73/100
pskillen/meshflow-api#472 ·
Los mantenedores suelen responder en 1 día
-
enhancement meshtastic-2.8
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
pskillen/meshflow-api#464 ·
Los mantenedores suelen responder en 1 día
Todos los issues de pskillen/meshflow-api
Issues similares
-
needs-area-label
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 2 días
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Official-Space-AI/OpenPhysGraspGen#114 ·
Los mantenedores suelen responder en 2 días
-
changelog investigate
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ramnes/notion-sdk-py#441 ·
-
qa_bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA-NeMo/Gym#5644 ·
Los mantenedores suelen responder en 2 días
-
BUG: catalog database credentials printed to logs at startupPosiblemente ocupada @cjboyle la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día