tsgrpc_kvstore driver - how to signal `generation_if_equal` mismatch on write?

Abierto
#251 13 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
28/100
Tipo de issue
Documentación
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
cpp, grpc
Área
api, backend

Línea de trabajo

Comienza con los comentarios de los protos WriteRequest y WriteResponse y con el código PerformWriteback vinculado en transaction.cc. Traza cómo se gestionan generation_if_equal, una generation desconocida y GenerationAndTimestamp, y documenta la respuesta de mismatch esperada, el comportamiento de retry y el significado del timestamp; verifica la explicación frente a la secuencia de escritura reportada.

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

Descripción

Hi,

I'm trying to implement a gRPC service for the tsgrpc_kvstore driver, and trying to understand how to correctly support the generation_if_equal option for WriteRequest. In particular, how to handle the case where the generation does not match - the comment in the proto says "the write is aborted" on a mismatch, what exactly does this mean?

Both returning an error from the RPC and returning an error in the WriteResponse.status field leads to the TensorStore write to fail immediately, which leads me to believe this is not what I should do?

Looking at PerformWriteback I see that the transaction is re-tried if the returned generation is "unknown" (== empty). However if I try this, TensorStore just sends writes with generation_if_equal=StorageGeneration::NoValue() in a loop, instead of what I would expect:

  1. Attempt a write with an old generation, receive StorageGeneration::Unknown
  2. Issue a read to obtain the current value of the file
  3. Issue a new write, with the update generation and value

thank you!

PS: I'm also a bit unclear what I should use for the timestamp value of GenerationAndTimestamp - is this intended to be the current time of the gRPC server? The last modified time of the file?

Lenguaje dominante
C++
Estrellas
1.6k
Forks
151
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

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 google/tensorstore

Todos los issues de google/tensorstore

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.