@ -213,9 +213,13 @@ func (l *DiskLocation) loadAllEcShards() (err error) {
// If .dat is gone, log error but don't clean up (may be waiting for shards from other servers)
// If .dat is gone, log error but don't clean up (may be waiting for shards from other servers)
if datExists {
if datExists {
glog . Warningf ( "Failed to load EC shards for volume %d and .dat exists: %v, cleaning up EC files to use .dat..." , volumeId , err )
glog . Warningf ( "Failed to load EC shards for volume %d and .dat exists: %v, cleaning up EC files to use .dat..." , volumeId , err )
// Clean up any partially loaded in-memory state before removing files
l . DestroyEcVolume ( volumeId )
l . removeEcVolumeFiles ( collection , volumeId )
l . removeEcVolumeFiles ( collection , volumeId )
} else {
} else {
glog . Warningf ( "Failed to load EC shards for volume %d: %v (this may be normal for distributed EC volumes)" , volumeId , err )
glog . Warningf ( "Failed to load EC shards for volume %d: %v (this may be normal for distributed EC volumes)" , volumeId , err )
// Clean up any partially loaded in-memory state even if we don't remove files
l . DestroyEcVolume ( volumeId )
}
}
sameVolumeShards = nil
sameVolumeShards = nil
prevVolumeId = 0
prevVolumeId = 0
@ -226,7 +230,7 @@ func (l *DiskLocation) loadAllEcShards() (err error) {
continue
continue
}
}
}
}
// Check for orphaned EC shards without .ecx file (incomplete EC encoding)
// Check for orphaned EC shards without .ecx file (incomplete EC encoding)
// This happens when encoding is interrupted after writing shards but before writing .ecx
// This happens when encoding is interrupted after writing shards but before writing .ecx