Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix store dir symbolic links #55202

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions pkg/storage/mvcc.go
Expand Up @@ -3758,7 +3758,13 @@ func computeCapacity(path string, maxSizeBytes int64) (roachpb.StoreCapacity, er
Available: maxSizeBytes,
}, nil
}
if err := fileSystemUsage.Get(dir); err != nil {

var err error
// Eval directory if it is a symbolic links.
if dir, err = filepath.EvalSymlinks(dir); err != nil {
return roachpb.StoreCapacity{}, err
}
if err = fileSystemUsage.Get(dir); err != nil {
return roachpb.StoreCapacity{}, err
}

Expand All @@ -3776,7 +3782,7 @@ func computeCapacity(path string, maxSizeBytes int64) (roachpb.StoreCapacity, er
// Find the total size of all the files in the r.dir and all its
// subdirectories.
var totalUsedBytes int64
if errOuter := filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
if errOuter := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if err != nil {
// This can happen if rocksdb removes files out from under us - just keep
// going to get the best estimate we can.
Expand Down