celestiaorg / celestiaorg/celestia-node

architecture (share/Getter): Getter should be atomic

Aperta
#1,663 1 commento 1 reazione 0 assegnatari Vedi su GitHub
area:shares enhancement
Lingua principale
Go
Stelle
996
Fork
1.1k
Merge medio
1g 6h
PR unite (30g)
34

Descrizione

### 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia esaminando l’implementazione di CascadeGetter in PR #1628 e il lavoro sui getter tracciato in #1488, #1489, #1490, #1491 e #1535. Esamina shrex.Getter e TeeGetter per la gestione della cancellazione e dei cambiamenti di stato. Il lavoro è completato quando i getter interessati mantengono il comportamento atomico in caso di cancellazione del contesto e l’elemento rimanente della checklist è stato affrontato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
go
Ambito
backend, distributed-systems
Tipo di issue
Refactoring
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.