[Commits] 1c4dc2e: MDEV-8178 - Wrong progress report for operations on InnoDB tables

Sergey Vojtovich svoj at mariadb.org
Wed Dec 9 14:03:15 EET 2015


revision-id: 1c4dc2e1942bbea425b36a54129781561f642abf (mariadb-10.0.22-35-g1c4dc2e)
parent(s): 50160216eab066de7a71dd8e355f0c5cb29c8789
committer: Sergey Vojtovich
timestamp: 2015-12-09 15:53:56 +0400
message:

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.

---
 storage/innobase/row/row0merge.cc | 7 ++-----
 storage/xtradb/row/row0merge.cc   | 7 ++-----
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 75aa423..3cf86c3 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -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;
diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc
index 3447d15..12c38fd 100644
--- a/storage/xtradb/row/row0merge.cc
+++ b/storage/xtradb/row/row0merge.cc
@@ -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;


More information about the commits mailing list