mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(client): FollowerRead retry after read request failed. #1000107530
Signed-off-by: zhumingze <zhumingze@oppo.com>
This commit is contained in:
parent
6662617ce1
commit
608b59ee91
@ -133,7 +133,7 @@ func (sc *StreamConn) getRetryTimeOut() time.Duration {
|
||||
func (sc *StreamConn) Send(retry *bool, req *Packet, getReply GetReplyFunc) (err error) {
|
||||
req.ExtentType |= proto.PacketProtocolVersionFlag
|
||||
log.LogDebugf("sc details: " + sc.String())
|
||||
if req.IsReadOperation() && !sc.dp.ClientWrapper.InnerReq() {
|
||||
if req.IsReadOperation() && !sc.dp.ClientWrapper.InnerReq() && !sc.dp.ClientWrapper.FollowerRead() {
|
||||
return sc.sendReadToDP(sc.dp, req, retry, getReply)
|
||||
}
|
||||
return sc.sendToDataPartitionLeader(req, retry, getReply)
|
||||
@ -141,7 +141,7 @@ func (sc *StreamConn) Send(retry *bool, req *Packet, getReply GetReplyFunc) (err
|
||||
|
||||
func (sc *StreamConn) sendReadToDP(dp *wrapper.DataPartition, req *Packet, retry *bool, getReply GetReplyFunc) (err error) {
|
||||
err = sc.sendToDataPartition(req, retry, getReply)
|
||||
if err == nil || dp.ClientWrapper.FollowerRead() || err == proto.ErrCodeVersionOp || strings.Contains(err.Error(), "OpForbidErr") || err == ExtentNotFoundError {
|
||||
if err == nil || err == proto.ErrCodeVersionOp || strings.Contains(err.Error(), "OpForbidErr") || err == ExtentNotFoundError {
|
||||
return
|
||||
}
|
||||
log.LogWarnf("sendReadToDP: send to leader failed, try to read quorum, req (%v), dp(%v), err(%v)", req, dp, err)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user