Skip to content

Commit

Permalink
MDEV-21269 Parallel merging of fts index rebuild fails
Browse files Browse the repository at this point in the history
Problem:
=======
  - During alter rebuild, document read from old table is tokenzied
parallelly by innodb_ft_sort_pll_degree threads and stores it
in respective merge files. While doing the parallel merge, InnoDB
wrongly skips the root level selection of merging buffer records.
So it leads to insertion of merge records in non-ascending order.

Solution:
==========
  Build selection tree for the root level also. So that root of
selection tree can always contain sorted buffer.
  • Loading branch information
Thirunarayanan committed May 17, 2020
1 parent 54c169a commit 4f26aea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions storage/innobase/row/row0ftsort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1528,10 +1528,11 @@ row_fts_build_sel_tree(
sel_tree[i + start] = int(i);
}

for (i = treelevel; --i; ) {
i = treelevel;
do {
row_fts_build_sel_tree_level(
sel_tree, i, mrec, offsets, index);
}
sel_tree, --i, mrec, offsets, index);
} while (i > 0);

return(treelevel);
}
Expand Down

1 comment on commit 4f26aea

@dr-m
Copy link
Contributor

@dr-m dr-m commented on 4f26aea May 18, 2020

Choose a reason for hiding this comment

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

I see that this was broken in ba19764 by me. Apparently, the old check i >= 0 was relying on i being signed.

Please sign in to comment.