A delete in a later mutation of a transaction is lost on @count uid predicates (the earlier set is committed)
Los mantenedores suelen responder en 10 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start in posting/list.go at MutableLayer.insertPosting, where a DEL of the transaction's own pending SET removes it and leaves an empty layer, then read LocalCache.UpdateDeltasAndDiscardLists in posting/lists.go, which skips storing empty deltas. Reproduce with two AddMutationWithIndex calls on a [uid] @count @reverse predicate, with txn.Update() between them, then CommitToDisk. Done when the forward, reverse and count lists are all empty after commit.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version: v25.5.1 and main e95fc2652.
Repro: schema knows: [uid] @reverse @count .; nodes 0x1, 0x2.
POST /mutate(nocommitNow):{ set { <0x1> <knows> <0x2> . } }; notestart_ts.POST /mutate?startTs=<start_ts>:{ delete { <0x1> <knows> <0x2> . } }.POST /commit?startTs=<start_ts>with the keys and preds.{ q(func: uid(0x1)) { knows { uid } count(knows) } }returnsknows: [0x2], count 1;~knowsof0x2holds
0x1. Expected: no edge. The same two operations in one mutation, or without@count, leave nothing.
Cause: for a count-indexed list, MutableLayer.insertPosting (posting/list.go) handles a DEL of the
transaction's own pending SET by removing the SET from currentEntries (no DEL posting is added, to keep counts
right). The layer is then empty and marshals to zero bytes. LocalCache.UpdateDeltasAndDiscardLists
(posting/lists.go) stores a list's delta only if len(data) > 0, so the delta written after the first mutation (the
SET) is kept and committed by CommitToDisk. The reverse list takes the same path.
Fix: when the transaction's mutation layer for the list exists and is empty, delete the stored delta:
if len(data) > 0 {
lc.deltas[key] = data
} else if pl.mutationEmptied(lc.startTs) { // layer present, no posting left
delete(lc.deltas, key)
}
with func (l *List) mutationEmptied(startTs uint64) bool { l.RLock(); defer l.RUnlock(); pl := l.mutationMap.get(startTs); return pl != nil && len(pl.Postings) == 0 }.
Test: a SET then a DEL of one uid edge as two AddMutationWithIndex calls with txn.Update() between, on
[uid] @count @reverse, then CommitToDisk: forward, reverse and count lists empty.
- 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