mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
enhance: clear exclude if no dp is selected
Signed-off-by: Shuoran Liu <shuoranliu@gmail.com>
This commit is contained in:
parent
03e4ec61a4
commit
9b41a7cefd
@ -3,6 +3,7 @@ package datanode
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"golang.org/x/time/rate"
|
||||
)
|
||||
|
||||
|
||||
@ -506,7 +506,8 @@ func (eh *ExtentHandler) allocateExtent() (err error) {
|
||||
for i := 0; i < MaxSelectDataPartitionForWrite; i++ {
|
||||
if eh.key == nil {
|
||||
if dp, err = eh.stream.client.dataWrapper.GetDataPartitionForWrite(exclude); err != nil {
|
||||
log.LogWarnf("allocateExtent: failed to get write data partition, eh(%v) exclude(%v)", eh, exclude)
|
||||
log.LogWarnf("allocateExtent: failed to get write data partition, eh(%v) exclude(%v), clear exclude and try again!", eh, exclude)
|
||||
exclude = make(map[string]struct{})
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ func (dp *DataPartition) CheckAllHostsIsAvail(exclude map[string]struct{}) {
|
||||
for i := 0; i < len(dp.Hosts); i++ {
|
||||
host := dp.Hosts[i]
|
||||
if conn, err = util.DailTimeOut(host, proto.ReadDeadlineTime*time.Second); err != nil {
|
||||
log.LogWarnf("Dail to Host (%v) err(%v)", host, err.Error())
|
||||
log.LogWarnf("CheckAllHostsIsAvail: dial host (%v) err(%v)", host, err)
|
||||
if strings.Contains(err.Error(), syscall.ECONNREFUSED.Error()) {
|
||||
exclude[host] = struct{}{}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user