celestiaorg / celestiaorg/celestia-node
architecture (share/Getter): Getter should be atomic
- Lenguaje dominante
- Go
- Estrellas
- 996
- Forks
- 1.1k
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 34
Descripción
### Implementation ideas
Current high order getter [CascadeGetter](https://github.com/celestiaorg/celestia-node/pull/1628) implementation assumes that if underlying getter request has been canceled by context, the overall getter operation should be noop, allowing next getter to start from unaffected state. Thus every getter implementation is required to satisfy atomic property of transaction. Also getter should treat external context cancelation as expected at any time and update internal state(if any) accordingly (e.g .shrex.Getter peer manager)
For example, shrex.Getter(not finished yet) should make more complex decision on peer in case of context.Deadline, taking into account possibility of external ctx cancelation.
TeeGetter should either finish write operation, or rollback internal storage state.
Future contributions to existing or introduced Getters should always take transactional property into account. This could affect introduction of caching, for example
Need to check all getters that are already merged and in development to identify if there is need to be any enhancements:
- [x] #1488
- [x] #1489
- [x] #1490
- [x] #1491
- [ ] #1535
Guía de contribución
Línea de trabajo
Comienza revisando la implementación de CascadeGetter en PR #1628 y el trabajo sobre getters registrado en #1488, #1489, #1490, #1491 y #1535. Examina shrex.Getter y TeeGetter para comprobar cómo gestionan la cancelación y los cambios de estado. Se considera terminado cuando los getters afectados conservan el comportamiento atómico al cancelarse el contexto y se ha abordado el elemento restante de la checklist.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- go
- Área
- backend, distributed-systems
- Tipo de issue
- Refactorización
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100