bug(native): delayed sync-complete can contaminate a re-added named root's lineage
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go, sqlite
- Área
- databases, distributed-systems
Línea de trabajo
Start with internal/p2p/routes.go, internal/p2p/syncengine/engine.go, and internal/store/game_roots.go to trace how a named-root report reaches the final SQLite write. Review the linked regression test and reproduction guide, then run the Go race regression suites. Done means stale reports cannot alter a replacement root’s lineage, valid reports still work, and the stated compatibility and build checks pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
A delayed sync-complete event from an authenticated peer can refer to an old mapping of a named root, arrive after that root is removed and re-added under the same name, and populate the replacement mapping's game_root_sync_state with old pulledFiles. Signing/attributing a report to a peer does not prove it refers to the current root incarnation.
Observed defect: persisted stale lineage metadata. This reproduction does not establish a destructive file write or deletion.
Affected source: Liquid-co/OpenSave:dev-public@a0f6032b8ba36da25e3e0e5e90c5ace9ba0c1fc7, with disposable native handler and SQLite fixtures on Linux amd64.
Independent reproduction
Public Go regression · Reproduction guide
git checkout repro/native-root-lineage-import-20261030
go test -count=1 -race -v ./internal/p2p -run '^TestRegressionDelayedReportCannotAttachToReaddedRoot$'
- Create a disposable native P2P fixture with an additional mapped
configroot. - Remove
config, then re-addconfigat a different temporary path. The replacement root's lineage should be empty. - Deliver a
sync-completeevent attributed to the fixture peer, namingroot: configandpulledFiles: ["old-save.bin"]from the old incarnation. - Read
game_root_sync_statefor the newconfig.
Stock result: old-save.bin is incorrectly recorded in the new root's lineage. Required result: the report does not mutate the replacement mapping's lineage.
The test uses the native P2P test handler; it is not a test of a complete deployed LAN/relay connection.
Source-level cause
internal/p2p/routes.go accepts a sync-complete event and forwards its root name and file list. internal/p2p/syncengine/engine.go can merge these paths against the current named root based on name alone. internal/store/game_roots.go stores mapping timestamps, but the incoming old event is not bound to the incarnation that produced it.
This is distinct from active-writer-versus-removal: a lock around the removal cannot identify a stale message arriving later.
Bounded suggested fix
Bind a named-root state-bearing report to a receiver-issued mapping generation (for example the receiver's mapped timestamp echoed by the pulling peer) and check that generation in the final authoritative SQLite write. On a missing/old token, do not accept the report as confirmed lineage; fall back to safe fresh manifest reconciliation where appropriate. Preserve current primary-root behaviour and protocol compatibility.
Avoid a global version-vector protocol, new distributed coordinator or general maintenance state.
Acceptance criteria
- Stock test fails for stale
old-save.bincontamination and patched test passes. - Old same-name reports cannot affect a replacement root after remove/re-add, including rapid re-add and remap.
- Valid new-root reports are recorded; LAN/relay callbacks and deletion lineage still behave correctly.
- Older peers lacking a generation token fail safely or reconcile with documented compatibility limits.
- Go/race regression suites and supported builds pass.
Evidence limit: No claim of user-save loss or that a full two-daemon delayed delivery has been executed by this public test.
Independent public reproducer and original report: https://github.com/Seagulls/OpenSave/issues/14.
- Lenguaje dominante
- Go
- Estrellas
- 225
- Forks
- 9
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 75
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin 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 Liquid-co/OpenSave
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Liquid-co/OpenSave#149 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
Feature request: Allow atomic placement of offered games with AutoSync disabledPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
Liquid-co/OpenSave#40 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de Liquid-co/OpenSave
Issues similares
-
Case detail: main-column section headers are hard to distinguish from body textPosiblemente ocupada @yubessy la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ubie-oss/hecatoncheires#347 ·
Los mantenedores suelen responder en 1 día
-
[OperatorHub] Add OLM installation method to the documentation #1193Posiblemente ocupada @NiccoloFei la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
cloudnative-pg/plugin-barman-cloud#1233 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 2 días
-
build: make check-linter version tests deterministicPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día