shard id starts from zero

This commit is contained in:
Chris Lu
2019-05-24 11:52:23 -07:00
parent 24b8ad9a14
commit 228850d588
5 changed files with 89 additions and 1 deletions

View File

@@ -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