A delete in a later mutation of a transaction is lost on @count uid predicates (the earlier set is committed)
Maintainer thường phản hồi trong vòng 10 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 21.8k
- Fork
- 1.6k
- Merge trung bình
- 11 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dgraph-io/dgraph
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 10 ngày
-
Broken links in the docsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 10 ngày
-
Stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
dgraph-io/dgraph#9811 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
-
Stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
dgraph-io/dgraph#9810 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 10 ngày
Tất cả issue của dgraph-io/dgraph
Issue tương tự
-
【文档错误】创建镜像空间步骤中的截图标注与文字描述不一致Đang mởenhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
DaoCloud/DaoCloud-docs#7839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support AlienVault OTX API keysĐang mởType: Enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
projectdiscovery/urlfinder#167 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
peterstace/simplefeatures#726 ·
-
area: import bug go good first issue priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
fukubie/StockLlama#69 ·
-
Add `rumpty firewall create|rm`Đang mởenhancement help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
cloverworks-hq/rumpty-cli#95 ·
Maintainer thường phản hồi trong vòng 1 ngày