Skip to content

Commit

Permalink
data sdk: check amount of writable data partitions when mount
Browse files Browse the repository at this point in the history
If there is no writable data partition, updateDataPartition will return
an error which leads to mount fail.

Signed-off-by: Shuoran Liu <shuoranliu@gmail.com>
  • Loading branch information
shuoranliu authored and awzhgw committed Jul 3, 2019
1 parent 96e0142 commit 9f55ccd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdk/data/wrapper/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ func (w *Wrapper) updateDataPartition() error {
if len(rwPartitionGroups) > 0 {
w.rwPartition = rwPartitionGroups
w.localLeaderPartitions = localLeaderPartitionGroups
} else {
err = errors.New("updateDataPartition: no writable data partition")
}

log.LogInfof("updateDataPartition: end!")
return nil
return err
}

func (w *Wrapper) replaceOrInsertPartition(dp *DataPartition) {
Expand Down

0 comments on commit 9f55ccd

Please sign in to comment.