TLC throw an error while verifying Raft TLA+ spec

Abierto
#40 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
java

Línea de trabajo

Read Raft/Raft.tla around lines 354–361 and check the TLC error output for the reported behavior. The issue proposes guarding the log term lookup when mentries is empty; verify the condition against the Raft spec and run TLC on the relevant model. Done means TLC completes without the reported tuple-to-integer exception.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

While checking the Raft TLA+ spec in this repo, TLC throw an error reporting that:

Error: TLC threw an unexpected exception.
This was probably caused by an error in the spec or model.
See the User Output or TLC Console for clues to what happened.
The exception was a java.lang.RuntimeException
: Attempted to apply tuple
<<>>
to integer 1 which is out of domain.
Error: The behavior up to this point is:
...

The TLA+ code triggered this error was:

https://github.com/pingcap/tla-plus/blob/8ae629ddf9f5ad8efc763bff93e3e43ce0a3585d/Raft/Raft.tla#L354-L361

The main problem is that TLC might still execute /\ log[i][index].term = m.mentries[1].term at line 358 even though m.mentries = << >> at line 356 is true(and that's how TLC evaluate an TLA+ expression). We might apply the patch below to fix the error:

 /\ LET index == m.mprevLogIndex + 1 
    IN \/ \* already done with request 
           /\ \/ m.mentries = << >> 
              \/ /\ Len(log[i]) >= index 
                 /\ m.mentries # << >>
                 /\ log[i][index].term = m.mentries[1].term 

PS: Is this repo still maintained? It seems that the TLA+ spec in this repo and the Raft implementation in TiKV have diverge quiet a lot!

Lenguaje dominante
TLA
Estrellas
314
Forks
36
Merge medio
2 min
PR fusionados (30 d)
1

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pingcap/tla-plus

Todos los issues de pingcap/tla-plus

Issues similares

Más issues de Distributed Systems

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.