Follow-ups to #681: decision count for a stopped view, regression tests, and cleanups
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- go
- Área
- distributed-systems
Línea de trabajo
Start by reading #681 and the controller and view changer code around Controller.decide, run, sync, and commitInFlightProposal; the issue does not name source or test file paths. Check completion_signal_test.go and trace how aborts interact with buffered decisions and in-flight Decide or Sync calls. Done means fixing the stopped-current-view decision count, adding tests that fail on the old behavior, and addressing the listed cleanups; the optional late-result recovery is a separate improvement.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Written by Claude (Anthropic's AI assistant) on behalf of Hagar Meir.
These are the points left open in the review of #681 (avoid blocking on completion signals when the waiter has left). They should be done in a separate PR once #681 is merged.
1. Decision count when the deciding view is still current but stopped (possible small bug)
In Controller.decide, isRunningCurrentView(d.view) returns false in two different cases:
- The view was replaced. Skipping all of the view bookkeeping is right.
- The view is still current but already stopped, for example when the run loop handles
abortViewChanbefore the decision buffered indecisionChan. The decision was delivered in this view, and the checkpoint moved to its sequence, butincrementCurrentDecisionsInViewis skipped.
In the second case, if the node then syncs and finds nothing newer, it restarts the same view with a count that is one too low:
runcallschangeView(c.getCurrentViewNumber(), vs.ProposalSeq, c.getCurrentDecisionsInView()), orsynckeepsnewDecisionsInView = c.getCurrentDecisionsInView()when the latest decision is at the controller's sequence.
With leader rotation on, getLeaderID can then give this node a different leader from the other nodes, until the next view change resets the count.
This is not a regression: before #681, the send on deliverChan failed in the same case and the increment was skipped too.
Proposed fix: when d.view is the current view but stopped, still call incrementCurrentDecisionsInView, and skip only checkIfRotate/changeView and acquireLeaderToken, the steps that could race the pending view change. Add a test for it.
2. Regression tests that fail on the old code
The tests added in #681 (completion_signal_test.go) pass on the old code as well:
decidenow only closesd.delivered, andclosenever blocks;- the in-flight tests call
decideInFlightandsyncInFlightdirectly, and their non-blocking sends never block either.
Tests that reproduce the original hangs would catch a regression:
- controller:
Decidereturns through the view's abort channel while the decision is still buffered indecisionChan, and the run loop must keep processing later events; - view changer:
commitInFlightProposaltimes out or is stopped, and the deferredinFlightView.Abort()must not hang on a lateDecideorSyncfrom the in-flight view.
3. Inconsistent nil checks
decide checks d.delivered != nil, but Decide always sets it. Meanwhile a nil d.view panics in isRunningCurrentView. The two fields are always set together, so both checks can be removed.
4. Comments in decide
- "the current view must not be rotated or lead because of it" is unclear. It could say that the leader token is not acquired.
- It could also say why skipping
acquireLeaderTokenis fine for a replaced view: the new view'sstartViewacquires the token when needed.
5. Optional: in-flight attempt result after a late decision
If the in-flight attempt times out or is stopped while the in-flight view is delivering its decision, the deferred Abort() waits for the delivery to finish, so the proposal was committed. commitInFlightProposal still returns false, and the node waits for the next view change. Since decideCh is buffered, a non-blocking receive on it after the abort could return true instead. This only affects how quickly the node recovers, not correctness.
- Lenguaje dominante
- Go
- Estrellas
- 110
- Forks
- 41
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 31
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 hyperledger/SmartBFT
-
Set up a pr projectAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
hyperledger/SmartBFT#666 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
hyperledger/SmartBFT#628 · 12 comentarios ·
Los mantenedores suelen responder en 1 día
-
Recording library runtime for bug analysis by developersQuizá libre de nuevo @HagarMeir la tomó hace 1737 días y no hay ningún pull request abierto. Abiertoenhancement
hyperledger/SmartBFT#487 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
hyperledger/SmartBFT#439 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
hyperledger/SmartBFT#420 ·
Los mantenedores suelen responder en 1 día
Todos los issues de hyperledger/SmartBFT
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
keyxmakerx/Chronicle#1721 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Gentleman-Programming/gentle-ai#5720 ·
Los mantenedores suelen responder en 1 día
-
compress: block buffers get re-zeroed on every call, and the zeroing is immediately overwrittenAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ClickHouse/ch-go#1218 ·
Los mantenedores suelen responder en 13 días
-
effort:s impact:low raised-by:reviewer risk:low
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
medici-finance/assay#4251 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
stripCodeFence unti testsAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Edwin-metcalf/MetCode#30 ·
Los mantenedores suelen responder en 1 día