MDEV-8178 - Wrong progress report for operations on InnoDB tables
Correct InnoDB calls to progress report API: - second argument of thd_progress_init() is number of stages, one stage is enough for the row merge - third argument of thd_progress_report() is some value indicating threshold, for the row merge it is file->offset - second argument of thd_progress_report() is some value indicating current state, for the row merge it is file->offset - num_runs.
This commit is contained in:
parent
d289ba808d
commit
b07043fd51
@ -2304,7 +2304,6 @@ row_merge_sort(
|
||||
{
|
||||
const ulint half = file->offset / 2;
|
||||
ulint num_runs;
|
||||
ulint cur_run = 0;
|
||||
ulint* run_offset;
|
||||
dberr_t error = DB_SUCCESS;
|
||||
DBUG_ENTER("row_merge_sort");
|
||||
@ -2328,18 +2327,16 @@ row_merge_sort(
|
||||
of file marker). Thus, it must be at least one block. */
|
||||
ut_ad(file->offset > 0);
|
||||
|
||||
thd_progress_init(trx->mysql_thd, num_runs);
|
||||
thd_progress_init(trx->mysql_thd, 1);
|
||||
|
||||
/* Merge the runs until we have one big run */
|
||||
do {
|
||||
cur_run++;
|
||||
|
||||
error = row_merge(trx, dup, file, block, tmpfd,
|
||||
&num_runs, run_offset);
|
||||
|
||||
/* Report progress of merge sort to MySQL for
|
||||
show processlist progress field */
|
||||
thd_progress_report(trx->mysql_thd, cur_run, num_runs);
|
||||
thd_progress_report(trx->mysql_thd, file->offset - num_runs, file->offset);
|
||||
|
||||
if (error != DB_SUCCESS) {
|
||||
break;
|
||||
|
@ -2312,7 +2312,6 @@ row_merge_sort(
|
||||
{
|
||||
const ulint half = file->offset / 2;
|
||||
ulint num_runs;
|
||||
ulint cur_run = 0;
|
||||
ulint* run_offset;
|
||||
dberr_t error = DB_SUCCESS;
|
||||
DBUG_ENTER("row_merge_sort");
|
||||
@ -2336,18 +2335,16 @@ row_merge_sort(
|
||||
of file marker). Thus, it must be at least one block. */
|
||||
ut_ad(file->offset > 0);
|
||||
|
||||
thd_progress_init(trx->mysql_thd, num_runs);
|
||||
thd_progress_init(trx->mysql_thd, 1);
|
||||
|
||||
/* Merge the runs until we have one big run */
|
||||
do {
|
||||
cur_run++;
|
||||
|
||||
error = row_merge(trx, dup, file, block, tmpfd,
|
||||
&num_runs, run_offset);
|
||||
|
||||
/* Report progress of merge sort to MySQL for
|
||||
show processlist progress field */
|
||||
thd_progress_report(trx->mysql_thd, cur_run, num_runs);
|
||||
thd_progress_report(trx->mysql_thd, file->offset - num_runs, file->offset);
|
||||
|
||||
if (error != DB_SUCCESS) {
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user