fix: ReplaceStore swaps the symlink, not the store, when the live store directory is a symlink
Maintainer thường phản hồi trong vòng 1 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
Read internal/graphstore/locks.go around ReplaceStore and internal/indexer/fullindex.go at the production call site; compare how #339 resolves store paths for lock files. The issue leaves the path-resolution approach open, and reproduction still needs confirmation. Done means a full index through a symlink updates the target store and keeps the symlink, or returns a clear error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Not reproduced yet. This comes from reading the code while fixing #339.
ReplaceStore(staging, live) in internal/graphstore/locks.go works on live as the caller passes it. It takes the swap lock, then calls os.Lstat(live) at line 118 of commit 990b6499.
If live is a symlink to the store directory, Lstat reports the link itself. The code then locks live at line 126 and calls exchangeDirs(staging, live) at line 131, which wraps fsatomic.ExchangeDirs. The exchange swaps the link's directory entry with staging.
The link name then holds the new index, and staging holds the symlink. The real store behind the link keeps the old index, and the link is gone.
The only production caller is run in internal/indexer/fullindex.go at line 184. codegraph init runs that full index. The same function exists on main with the same shape.
What you expected instead
One store has one identity, whatever name opens it. A full index through a symlinked store path must replace the store the link points to and keep the link. Otherwise, it must refuse with a clear error.
Whether ReplaceStore resolves live through resolveStorePath, as the #339 fix does for the lock files, is an open question.
Steps to reproduce
- Create a store at
real/storewith a full index. - Run
ln -s real/store link. - Run a full index with the store path set to
link. The flag or setting for the store path is not confirmed yet. - Run
ls -l link, then see whetherreal/storeholds the new index.
Version
Built from source at commit 990b6499 on branch fix/339-swap-lock-realpath. The same function exists on main.
Platform
macOS, Darwin 27.2.0
How did you install it?
Built from source
Languages in the affected repository
Not applicable. The bug is in store path handling, not in extraction.
Related
#339 moves the swap and writer lock files beside the resolved store path. #324 covers letter case, and #286 covers path spellings for serve.
Before submitting
- I searched existing issues and this is not a duplicate
- I checked the capability matrix and this is not a documented limitation
- This is not a security vulnerability
🤖 Generated with Claude Code
- Ngôn ngữ chính
- Go
- Star
- 0
- Fork
- 0
- Merge trung bình
- 7 giờ 42 phút
- Pull request đã merge (30 ngày)
- 111
Chuẩn bị môi trường
- Không có Dockerfile hay 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 seanb4t/codegraph-go
-
chore needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
seanb4t/codegraph-go#380 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
seanb4t/codegraph-go#379 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:query chore needs-triage spec-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
seanb4t/codegraph-go#377 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
seanb4t/codegraph-go#362 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:query bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
seanb4t/codegraph-go#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của seanb4t/codegraph-go
Issue tương tự
-
go-vulnerability security-scan
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
teslashibe/agent-go#35 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
alecthomas/chroma#1498 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 8 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày