summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2015-12-15 20:37:33 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2015-12-15 20:37:33 +0200
commit1ac6640210bb337ecdfa9f8b818cc3c6156dbdcc (patch)
tree9dfb79df20f60a433a6c0ae406bee44cb9125988
parent477c84d51e9b386baadc053e017c019aaac68fc8 (diff)
downloadmariadb-git-1ac6640210bb337ecdfa9f8b818cc3c6156dbdcc.tar.gz
MDEV-9129: Server is restarting in the loop after crash
Analysis: We have reserved ROW_MERGE_RESERVE_SIZE ( = 4) for encryption key_version. When calculating is there more space on sort buffer, this value needs to be substracted from current available space.
-rw-r--r--storage/innobase/include/row0merge.h3
-rw-r--r--storage/innobase/row/row0ftsort.cc6
-rw-r--r--storage/innobase/row/row0merge.cc18
-rw-r--r--storage/xtradb/include/row0merge.h3
-rw-r--r--storage/xtradb/row/row0ftsort.cc6
-rw-r--r--storage/xtradb/row/row0merge.cc18
6 files changed, 40 insertions, 14 deletions
diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h
index fa00700b225..196543f25e1 100644
--- a/storage/innobase/include/row0merge.h
+++ b/storage/innobase/include/row0merge.h
@@ -41,6 +41,9 @@ Created 13/06/2005 Jan Lindstrom
#include "lock0types.h"
#include "srv0srv.h"
+/* Reserve free space from every block for key_version */
+#define ROW_MERGE_RESERVE_SIZE 4
+
/* Cluster index read task is mandatory */
#define COST_READ_CLUSTERED_INDEX 1.0
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index f970938f729..4c021973b9a 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -557,9 +557,11 @@ row_merge_fts_doc_tokenize(
fts_max_token_size, add one extra size and one extra byte */
cur_len += 2;
- /* Reserve one byte for the end marker of row_merge_block_t. */
+ /* Reserve one byte for the end marker of row_merge_block_t
+ and we have reserved ROW_MERGE_RESERVE_SIZE (= 4) for
+ encryption key_version in the beginning of the buffer. */
if (buf->total_size + data_size[idx] + cur_len
- >= srv_sort_buf_size - 1) {
+ >= (srv_sort_buf_size - 1 - ROW_MERGE_RESERVE_SIZE)) {
buf_full = TRUE;
break;
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index c921c5b7318..f5cc33fb57d 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -78,8 +78,6 @@ UNIV_INTERN char srv_disable_sort_file_cache;
/* Maximum pending doc memory limit in bytes for a fts tokenization thread */
#define FTS_PENDING_DOC_MEMORY_LIMIT 1000000
-/* Reserve free space from every block for key_version */
-#define ROW_MERGE_RESERVE_SIZE 4
/******************************************************//**
Encrypt a merge block. */
@@ -2571,7 +2569,11 @@ 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);
+ /* Progress report only for "normal" indexes. */
+ if (!(dup->index->type & DICT_FTS)) {
+ thd_progress_init(trx->mysql_thd, num_runs);
+ }
+
sql_print_information("InnoDB: Online DDL : merge-sorting has estimated %lu runs", num_runs);
/* Merge the runs until we have one big run */
@@ -2580,7 +2582,10 @@ row_merge_sort(
/* Report progress of merge sort to MySQL for
show processlist progress field */
- thd_progress_report(trx->mysql_thd, cur_run, num_runs);
+ /* Progress report only for "normal" indexes. */
+ if (!(dup->index->type & DICT_FTS)) {
+ thd_progress_report(trx->mysql_thd, cur_run, num_runs);
+ }
sql_print_information("InnoDB: Online DDL : merge-sorting current run %lu estimated %lu runs", cur_run, num_runs);
error = row_merge(trx, dup, file, block, tmpfd,
@@ -2605,7 +2610,10 @@ row_merge_sort(
mem_free(run_offset);
- thd_progress_end(trx->mysql_thd);
+ /* Progress report only for "normal" indexes. */
+ if (!(dup->index->type & DICT_FTS)) {
+ thd_progress_end(trx->mysql_thd);
+ }
DBUG_RETURN(error);
}
diff --git a/storage/xtradb/include/row0merge.h b/storage/xtradb/include/row0merge.h
index fa00700b225..196543f25e1 100644
--- a/storage/xtradb/include/row0merge.h
+++ b/storage/xtradb/include/row0merge.h
@@ -41,6 +41,9 @@ Created 13/06/2005 Jan Lindstrom
#include "lock0types.h"
#include "srv0srv.h"
+/* Reserve free space from every block for key_version */
+#define ROW_MERGE_RESERVE_SIZE 4
+
/* Cluster index read task is mandatory */
#define COST_READ_CLUSTERED_INDEX 1.0
diff --git a/storage/xtradb/row/row0ftsort.cc b/storage/xtradb/row/row0ftsort.cc
index 55ac0a7d423..c7a5b51ef55 100644
--- a/storage/xtradb/row/row0ftsort.cc
+++ b/storage/xtradb/row/row0ftsort.cc
@@ -560,9 +560,11 @@ row_merge_fts_doc_tokenize(
fts_max_token_size, add one extra size and one extra byte */
cur_len += 2;
- /* Reserve one byte for the end marker of row_merge_block_t. */
+ /* Reserve one byte for the end marker of row_merge_block_t
+ and we have reserved ROW_MERGE_RESERVE_SIZE (= 4) for
+ encryption key_version in the beginning of the buffer. */
if (buf->total_size + data_size[idx] + cur_len
- >= srv_sort_buf_size - 1) {
+ >= (srv_sort_buf_size - 1 - ROW_MERGE_RESERVE_SIZE)) {
buf_full = TRUE;
break;
diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc
index 3ac18eb95d9..8e0ed3780ae 100644
--- a/storage/xtradb/row/row0merge.cc
+++ b/storage/xtradb/row/row0merge.cc
@@ -78,8 +78,6 @@ UNIV_INTERN char srv_disable_sort_file_cache;
/* Maximum pending doc memory limit in bytes for a fts tokenization thread */
#define FTS_PENDING_DOC_MEMORY_LIMIT 1000000
-/* Reserve free space from every block for key_version */
-#define ROW_MERGE_RESERVE_SIZE 4
/******************************************************//**
Encrypt a merge block. */
@@ -2578,7 +2576,11 @@ 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);
+ /* Progress report only for "normal" indexes. */
+ if (!(dup->index->type & DICT_FTS)) {
+ thd_progress_init(trx->mysql_thd, num_runs);
+ }
+
sql_print_information("InnoDB: Online DDL : merge-sorting has estimated %lu runs", num_runs);
/* Merge the runs until we have one big run */
@@ -2587,7 +2589,10 @@ row_merge_sort(
/* Report progress of merge sort to MySQL for
show processlist progress field */
- thd_progress_report(trx->mysql_thd, cur_run, num_runs);
+ /* Progress report only for "normal" indexes. */
+ if (!(dup->index->type & DICT_FTS)) {
+ thd_progress_report(trx->mysql_thd, cur_run, num_runs);
+ }
sql_print_information("InnoDB: Online DDL : merge-sorting current run %lu estimated %lu runs", cur_run, num_runs);
error = row_merge(trx, dup, file, block, tmpfd,
@@ -2612,7 +2617,10 @@ row_merge_sort(
mem_free(run_offset);
- thd_progress_end(trx->mysql_thd);
+ /* Progress report only for "normal" indexes. */
+ if (!(dup->index->type & DICT_FTS)) {
+ thd_progress_end(trx->mysql_thd);
+ }
DBUG_RETURN(error);
}