-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.report/customerCustomers have encountered this bug.Customers have encountered this bug.sig/executionSIG executionSIG executiontype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Enhancement
When indexLookUpExecutor is closed before its index/table worker finished(it may be caused by limit operator), it will use cancelFunc to inform index/tableWork. Currently, this will lead to useless error logs: "[2025/05/12 10:25:18.142 +08:00] [ERROR] [distsql.go:1572] ["table reader fetch next chunk failed"] [conn=2120221196] [session_alias=] [error="context canceled"]"
- LimitExec returns nil when fetches enough rows, and its Close function will be called next:
Lines 429 to 431 in 2503d50
if e.cursor >= e.end { return nil } - When indexLookUpExecutor's Close function is called, it will call its cancelFunc to inform index/tableWork:
Lines 898 to 901 in 2503d50
if e.cancelFunc != nil { e.cancelFunc() e.cancelFunc = nil } - In coprocessor, each time it tries to receive response, it checks the context status, and return error when context canceled:
tidb/pkg/store/copr/coprocessor.go
Lines 1130 to 1134 in 2503d50
resp, ok, closed = it.recvFromRespCh(ctx, it.respChan) if !ok || closed { it.actionOnExceed.close() return nil, errors.Trace(ctx.Err()) } - In indexLookUpExecutor's tableWork, it outputs error log when errors returned from coprocessor:
Lines 1564 to 1567 in 2503d50
if err != nil { logutil.Logger(ctx).Error("table reader fetch next chunk failed", zap.Error(err)) return err }
Metadata
Metadata
Assignees
Labels
affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.report/customerCustomers have encountered this bug.Customers have encountered this bug.sig/executionSIG executionSIG executiontype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.