fix(restore): max uid lease ignores uids that only appear as edge targets
I maintainer di solito rispondono entro 10 giorni
@aliassar ci sta già lavorando.
Dal 4/11/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- databases, distributed-systems
Direzione di ricerca
Start at processKV in worker/restore_map.go (around line 339), where maxUid is taken from the parsed key, and trace how the map phase writes its output and where the uid lease is bumped after restore. The gap is that uids inside uid-edge posting list values are never decoded, so a fix means decoding those values and folding them into maxUid; the alternative manifest approach is described in the issue. Done means a restore lease covers a node that appears only as an edge target, verified against the example <0x1> <friend> _:new . case. Note the author has not reproduced it end to end, so confirm the behaviour before changing it.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
After a restore, Zero's uid lease is bumped to the max uid the restore map phase saw. That max only covers uids that appear in keys, so a node that exists only as the target of a uid edge isn't counted. Zero can then hand that uid to a new node, and the new node silently inherits the restored incoming edges.
This affects both the online /admin restore and dgraph restore -z (once #9869 lands, since before that the offline path didn't bump the uid lease at all).
Root cause
In the map phase, processKV takes the max uid from the parsed key:
The object uids inside uid-edge posting lists are never looked at. A uid only shows up in a key if the node has at least one outgoing predicate, or if the incoming edge's predicate has @reverse.
Example
<0x1> <friend> _:new .
If _:new gets no predicates of its own and friend has no @reverse, its uid lives only in the posting list value of <0x1> <friend>. The newest node usually holds the highest uid, so this isn't a rare corner case. After restoring a backup taken at this point, the lease ends up below _:new's uid, and the next blank node assigned that uid picks up the friend edge from 0x1. Nothing reports an error.
I found this by reading the code while reviewing #9869 and haven't reproduced it end to end yet.
Possible fix
Decode uid posting values in the map phase and fold their uids into maxUid. That adds work proportional to the number of uid edges in the backup. A cheaper option would be to record Zero's max leased uid in the backup manifest when the backup is taken and bump to that on restore, but older backups wouldn't have it.
- Lingua principale
- Go
- Stelle
- 21.8k
- Fork
- 1.6k
- Merge medio
- 11g 7h
- PR unite (30g)
- 5
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dgraph-io/dgraph
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 10 giorni
-
Broken links in the docsAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
I maintainer di solito rispondono entro 10 giorni
-
Stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
dgraph-io/dgraph#9811 · 1 commento ·
I maintainer di solito rispondono entro 10 giorni
-
Stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
dgraph-io/dgraph#9810 · 1 commento ·
I maintainer di solito rispondono entro 10 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 10 giorni
Tutte le issue di dgraph-io/dgraph
Issue simili
-
【文档错误】创建镜像空间步骤中的截图标注与文字描述不一致Apertaenhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
DaoCloud/DaoCloud-docs#7839 ·
I maintainer di solito rispondono entro 1 giorno
-
Type: Enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
projectdiscovery/urlfinder#167 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
peterstace/simplefeatures#726 ·
-
area: import bug go good first issue priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fukubie/StockLlama#69 ·
-
enhancement help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
cloverworks-hq/rumpty-cli#95 ·
I maintainer di solito rispondono entro 1 giorno