mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix collect filer files
This commit is contained in:
parent
3cedb21bb7
commit
3817e05dd0
|
@ -165,15 +165,16 @@ func (c *commandVolumeFsck) collectFilerFileIdAndPaths(dataNodeVolumeIdToVInfo m
|
||||||
files := make(map[uint32]*os.File)
|
files := make(map[uint32]*os.File)
|
||||||
for _, volumeIdToServer := range dataNodeVolumeIdToVInfo {
|
for _, volumeIdToServer := range dataNodeVolumeIdToVInfo {
|
||||||
for vid := range volumeIdToServer {
|
for vid := range volumeIdToServer {
|
||||||
|
if _, ok := files[vid]; ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
dst, openErr := os.OpenFile(getFilerFileIdFile(tempFolder, vid), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
|
dst, openErr := os.OpenFile(getFilerFileIdFile(tempFolder, vid), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
|
||||||
if openErr != nil {
|
if openErr != nil {
|
||||||
return fmt.Errorf("failed to create file %s: %v", getFilerFileIdFile(tempFolder, vid), openErr)
|
return fmt.Errorf("failed to create file %s: %v", getFilerFileIdFile(tempFolder, vid), openErr)
|
||||||
}
|
}
|
||||||
if _, ok := volumeIdToServer[vid]; !ok {
|
|
||||||
files[vid] = dst
|
files[vid] = dst
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
defer func() {
|
defer func() {
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
Loading…
Reference in a new issue