ENH: Replace the selected-import transaction in DataStructure with a smaller design
Los mantenedores suelen responder en 6 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Read the design review of #1934, especially decisions D1, D3, D4, D7 and D8, then inspect DataStructure, BaseGroup and ImportH5ObjectPathsAction used by ReadDREAM3DFilter. Compare the current publish and rollback failure behavior with a smaller insertion and cleanup mechanism, preserving the listed checks and import behavior. Done means simplifying the transaction, removing unnecessary states, errors and hooks, and updating tests for values, IDs, aliases and geometry references.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Replace the import-specific publish and rollback transaction that #1934 adds to DataStructure with a smaller design. This is a follow-up to the out-of-core review PR tree. #1934 ("Plan selected imports against the complete destination") merges with the current design. During review it was decided to merge it now and to simplify it here.
How it works after #1934
ImportH5ObjectPathsAction, used by ReadDREAM3DFilter, builds the whole selected import in a copy of the destination (the prepared structure) and then publishes it. Publishing and rollback are in DataStructure:
DataStructure::ImportPublicationCheckpoint, a public value class that records the destination and its next ID when the action starts. Publishing rejects a checkpoint from another destination (-6217) or with a changed next ID (-6218).DataStructure::publishImportedObjects(...), which inserts all prepared objects and rolls them back on failure.- Partial-cleanup states (
Conflict,Children,Refused), errors -6215 and -6216 and retained-object records for a rollback that cannot finish. - Test-only fault injection in the public
DataStructure.hppand in the action (setPublicationFaultForTesting,cleanupFailedImportForTestingand related functions).
This is about 840 lines in DataStructure and BaseGroup, and one action uses all of it.
Why it is needed
Review found no normal input that makes publishing fail after the checks that run before it. Only std::bad_alloc and injected test faults reach the cleanup states: Refused is reached only by a test hook, and no normal trigger was shown for Conflict or Children. No in-tree caller can trigger the checkpoint errors, because the resolver and the finalizer run on the prepared structure, not on the destination.
Requested change
- Keep the checks that run before publishing. Report a failure and stop the pipeline. Do not treat a failed import as complete.
- Publish with a smaller mechanism, for example the normal insert path plus a list of inserted IDs that are removed in reverse order on an exception. The mechanism is still open.
- Remove the partial-cleanup states, errors -6215 and -6216 and the retained records, unless a real case is found that needs them.
- Remove the public checkpoint class and errors -6217 and -6218, unless a current caller needs them. Keep the normal path, parent and ID checks.
- Send no
DataRemovedMessagefor objects that were inserted and then rolled back before their addition was announced. Today rollback sends removal messages, but publishing sends no addition messages. - Remove the test hooks that the smaller design no longer needs.
Do not describe the result as an all-or-nothing guarantee. An insertion can fail after it changes part of the hierarchy but before its ID is registered, and cleanup can itself allocate or fail. The existing IDataAction contract allows an inconsistent destination after an error. Before replacing the current code, check that the smaller design does not make failure behavior worse than it is now. If it does, keep the needed protection.
Keep unchanged
- Aliases (two selected paths to one source object) still import as separate copies with their own IDs and remapped geometry references.
- The prepared structure is not swapped into the destination, because a swap would replace existing objects and invalidate pointers to them.
- Both modes of the metadata cache, and the public
fetch()behavior.
Tests
Keep the existing tests of values, IDs, aliases and geometry references. Where a failure must still be tested, use a real failure when one reliably reaches the step on Linux, Windows and macOS. Keep a focused hook only for a case that cannot be reached otherwise, for example an allocation failure partway through an insertion.
The design review of #1934 lists these options as decisions D1, D3, D4, D7 and D8.
- Lenguaje dominante
- C++
- Estrellas
- 18
- Forks
- 15
- Merge medio
- 4 d 23 h
- PR fusionados (30 d)
- 42
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la 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 BlueQuartzSoftware/simplnx
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
BlueQuartzSoftware/simplnx#1987 ·
Los mantenedores suelen responder en 6 días
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
BlueQuartzSoftware/simplnx#1980 ·
Los mantenedores suelen responder en 6 días
-
Testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
BlueQuartzSoftware/simplnx#1979 ·
Los mantenedores suelen responder en 6 días
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
BlueQuartzSoftware/simplnx#1978 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
BlueQuartzSoftware/simplnx#1945 ·
Los mantenedores suelen responder en 6 días
Todos los issues de BlueQuartzSoftware/simplnx
Issues similares
-
bug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
26.04 bug dark-mode Easy Hack impress symptom: visual
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
CollaboraOnline/online#16421 · 1 comentario ·
-
area/cs bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ydb-platform/ydb#59881 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
documentation enhancement lua server
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100