Browse Source

fmt

pull/7384/head
chrislu 1 month ago
parent
commit
f20d7c3bd5
  1. 6
      weed/storage/disk_location_ec.go

6
weed/storage/disk_location_ec.go

@ -318,12 +318,12 @@ func (l *DiskLocation) checkOrphanedShards(shards []string, collection string, v
if len(shards) == 0 || volumeId == 0 {
return false
}
// Check if .dat file exists (incomplete encoding, not distributed EC)
// Use os.Stat for robust error handling; unexpected errors treated as "exists"
baseFileName := erasure_coding.EcShardFileName(collection, l.Directory, int(volumeId))
datFileName := baseFileName + ".dat"
datExists := false
if _, err := os.Stat(datFileName); err == nil {
datExists = true
@ -332,7 +332,7 @@ func (l *DiskLocation) checkOrphanedShards(shards []string, collection string, v
// Safer to assume local .dat exists to avoid misclassifying as distributed EC
datExists = true
}
if datExists {
glog.Warningf("Found %d EC shards without .ecx file for volume %d (incomplete encoding interrupted before .ecx creation), cleaning up...",
len(shards), volumeId)

Loading…
Cancel
Save