Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executor: fix dead loop for indexMergeJoin in paging. #35918

Merged
merged 5 commits into from
Jul 11, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3873,6 +3873,12 @@ func (builder *dataReaderBuilder) buildTableReaderForIndexJoin(ctx context.Conte
lookUpContents []*indexJoinLookUpContent, indexRanges []*ranger.Range, keyOff2IdxOff []int,
cwc *plannercore.ColWithCmpFuncManager, canReorderHandles bool, memTracker *memory.Tracker, interruptSignal *atomic.Value) (Executor, error) {
e, err := buildNoRangeTableReader(builder.executorBuilder, v)
if !canReorderHandles {
// If we can't reorder handles, the kvRange maybe not ordered. The test case(see issue35831) for IndexMergeJoin will fail.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`canReorderHandles` is set to false only in IndexMergeJoin. IndexMergeJoin will trigger a dead loop problem when enabling paging(tidb/issues/35831). But IndexMergeJoin is not visible to the user and is deprecated for now. Thus we disable paging here.

// Now IndexMergeJoin is not GA and not maintained temporarily.
// So we close paging protocol in IndexMergeJoin request, and use the non-paging logic to read data.
e.paging = false
}
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -4072,6 +4078,7 @@ func (builder *dataReaderBuilder) buildTableReaderBase(ctx context.Context, e *T
SetIsStaleness(e.isStaleness).
SetFromSessionVars(e.ctx.GetSessionVars()).
SetFromInfoSchema(e.ctx.GetInfoSchema()).
SetPaging(e.paging).
Build()
if err != nil {
return nil, err
Expand Down