predicate moves not reliable / durable
Los mantenedores suelen responder en 10 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- go
- Área
- backend, databases, distributed-systems
Línea de trabajo
Empieza rastreando predicate_move.go, tablet.go, oracle.go, worker/predicate_move, worker/draft.go, posting/writer.go y la ruta populateKeyValues. Reproduce un predicate move grande con el Dgraph 25.3.7 indicado, un Zero y tres Alphas; después inspecciona timeout, batching, task ownership, verification, locking y restart behavior. Se considerará completado cuando los predicate moves terminen de forma fiable en predicados grandes y ante interrupciones o cambios de liderazgo, sin perder silenciosamente todo el progreso ni reiniciarlo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
We're trying to move predicates and there's reliability issues where the predicates take too long and timeout and fail to move. Being able to move predicates (any size from 0GB to 1TB) should be durable/reliable/as-fast-as-it-can.
Dgraph version: 25.3.7
Dgraph setup: 1 zero, 3 alphas(each with their own group)
Two separate issues:
- Fix the timeout logic
- Improve the speed/reliability of the predicate moves
For the timeout logic, some apparent items that might be worth addressing:
It appears there's a hardcoded timeout of 120 minutes in the tablet.go and so smaller predicates have no issue, it's the larger ones that hit the ceiling. It appears if there's any hiccup and ctx.Done() the whole move is discarded and cannot be resumed.
It also looks like populateKeyValues uses one badger txn per key in the predicate_move.go and posting/writer.go, looks like TxnWriter.Write loops calling SetAt per KV, and SetAt opens/commits a separate managed txn per key. For a 32MB batch of small posting lists that's tens of thousands of CommitAt calls per proposal.
proposeAndWait is called serially with a 3-message channel in predicate_mov.go if size >= 32<<20....the receiver blocks on each 32mb raft round-trip(propose->replicate->fsync->apply) before accepting the next batch. there is no pipelining. chan buffers=3 head-of-line-blocks the sender's stream.Orchestrate goroutines almost immediately.
Sender-side rollup is done inline, single-value-per-key, on the hot path....predicate_move.go rollup decodes every version,merges, re-encodes. On a heavily-mutated predicate this is cpu-bound and runs inside Stream.KeyToList, which badger parallelizes across numgo routines - but NumGo is left at the default and isn't tuned there.
For the speed/reliability:
Every byte goes through the destination raft log, 3x write amplification, serial, fsync-bound...worker/predicate_move(batchAndProposeKeyValues) an worker/draft.go....each 32mb batch marshalled into a raft entry, appended + fsync to raftwal on the dest leader.....the nreplicaed to and fsynced on ever follower's raftwal....then applied via populateKeyValues -> TxnWriter.SetAt - one badger transaction per key(writer.go), which goes through the LSM write path(memtable->l0) with fll compaction pressure.
startTask(opPredMove) only guards the source leader....predicate_move.go - the receiver never registers a task, so on the destination opRollup/opBackup can run concurrently with ingestion, and the comment at line 258 admits it's a guess.....at larger predicates, concurrent rollup on the dest fights the ingest for LSM write bandwidth
Key-count "verification" is cosmetic
predicate_move.go - the receiver returns a count, the sender logs it, and nothing compares it to anything. there's no send-side count, cno checksum, no failure path.
blockTablet holds a cluster-wide write lock on the predicate for the entire move...tablet.go + oracle.go - every commit touching this predicate is aborted for the full duration...for a large predicate move, that could be hours of write-unavaibility on a hot predicate, and it's held even during a post-move CleanPredicate on the source
Zero leadership change or moveOngoing slot loss silently orphans state...tablet.go uses a channel semaphore in zero memory only. if zero leader changes mid-move, blockCommitsOn is lost and ownership was never flipped so the dest now holds stale garbage that only the next successful move's CleanPredicate will remove.
no resumability/checkpointing, any failures restarts from zero...no progress marker, if the context expires, grpc drops, or re-election, or zero restarts, the next attempt re-issues CleanPredicate on the destination which deletes everything already transferred...it also re-streams from key 0
- Lenguaje dominante
- Go
- Estrellas
- 21.8k
- Forks
- 1.6k
- Merge medio
- 11 d 7 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 dgraph-io/dgraph
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 10 días
-
Broken links in the docsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
Los mantenedores suelen responder en 10 días
-
Stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
dgraph-io/dgraph#9811 · 1 comentario ·
Los mantenedores suelen responder en 10 días
-
Stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
dgraph-io/dgraph#9810 · 1 comentario ·
Los mantenedores suelen responder en 10 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 10 días
Todos los issues de dgraph-io/dgraph
Issues similares
-
【文档错误】创建镜像空间步骤中的截图标注与文字描述不一致Abiertoenhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
DaoCloud/DaoCloud-docs#7839 ·
Los mantenedores suelen responder en 1 día
-
Support AlienVault OTX API keysAbiertoType: Enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
projectdiscovery/urlfinder#167 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
peterstace/simplefeatures#726 ·
-
area: import bug go good first issue priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
fukubie/StockLlama#69 ·
-
Add `rumpty firewall create|rm`Abiertoenhancement help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
cloverworks-hq/rumpty-cli#95 ·
Los mantenedores suelen responder en 1 día