mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 11:25:09 +08:00
shard id starts from zero
This commit is contained in:
@@ -94,7 +94,7 @@ func encodeData(file *os.File, enc reedsolomon.Encoder, startOffset, blockSize i
|
||||
|
||||
func openEcFiles(baseFileName string, forRead bool) (files []*os.File, err error) {
|
||||
for i := 0; i < DataShardsCount+ParityShardsCount; i++ {
|
||||
fname := baseFileName + ToExt(i+1)
|
||||
fname := baseFileName + ToExt(i)
|
||||
openOption := os.O_TRUNC | os.O_CREATE | os.O_WRONLY
|
||||
if forRead {
|
||||
openOption = os.O_RDONLY
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package erasure_coding
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||
)
|
||||
@@ -61,3 +63,7 @@ func (ecInfo *EcVolumeInfo) ToVolumeEcShardInformationMessage() (ret []*master_p
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (ecInfo *EcVolumeInfo) String() string {
|
||||
return fmt.Sprintf("id:%d shard:%v collection:%v", ecInfo.VolumeId, ecInfo.ShardIds(), ecInfo.Collection)
|
||||
}
|
||||
|
Reference in New Issue
Block a user