Bug#1634932: Assertion failure in thread x in file fts0que.cc#1297
Conversation
|
Same comment re. Launchpad bug handling as in the other PRs |
|
The commit message should be slightly more descriptive ("foo and bar allocated but did not free baz in the case of error") |
|
Can you tell why the testcase is time and resource consuming? Is it possible to reduce it? |
| } | ||
|
|
||
|
|
||
| /*******************************************************************//** |
There was a problem hiding this comment.
New InnoDB code should use the new InnoDB function header comment style (see e.g. fts_ast_string_create, innobase_mysql_tmpfile, fil_rename_tablespace_check for examples)
| static | ||
| void | ||
| fts_query_free_intersection( | ||
| fts_query_t* query) /*!< in: query instance */ |
There was a problem hiding this comment.
Either here, either in the function body the indentation is wrong (should be tabs everywhere)
| /* error is passed by 'query->error' */ | ||
| if (query->error != DB_SUCCESS) { | ||
| ut_ad(query->error == DB_FTS_EXCEED_RESULT_CACHE_LIMIT); | ||
| fts_query_free_intersection(query); |
There was a problem hiding this comment.
Indentation (should be tabs)
| query, ranking->doc_id, ranking->rank); | ||
|
|
||
| if (query->error != DB_SUCCESS) { | ||
| if (query->oper == FTS_EXIST && query->intersection != NULL) |
There was a problem hiding this comment.
The query->oper == FTS_EXIST check looks redundant: the function asserts query->intersection == NULL at the start and only sets it to something if that check passes
There was a problem hiding this comment.
Can replace with an ut_ad(query->oper == FTS_EXIST) if the branch is taken
d677ed4 to
d419459
Compare
| @@ -0,0 +1,50 @@ | |||
| --echo # | |||
There was a problem hiding this comment.
Please use upstream bug number for upstream bugs (ie. bug83648.test). After the Percona Server merge the next step is to send the bugfix to Oracle (get your Percona OCA sorted out meanwhile)
|
|
||
| -- source include/have_innodb.inc | ||
|
|
||
| # Must have debug code to use SET SESSION debug |
There was a problem hiding this comment.
Redundant comment
| delimiter ;// | ||
|
|
||
| call populate_t1; | ||
| SET autocommit=1; |
There was a problem hiding this comment.
not needed, from documentation: "If autocommit is 0 and you change it to 1, MySQL performs an automatic COMMIT of any open transaction"
| call populate_t1; | ||
| SET autocommit=1; | ||
|
|
||
| let @saved_session_debug= @@session.debug; |
There was a problem hiding this comment.
No need to save and restore session variables - MTR will disconnect the session at the end of the testcase. Only global variables have to be saved and restored
| SET autocommit=1; | ||
|
|
||
| let @saved_session_debug= @@session.debug; | ||
| SET SESSION debug="d,fts_instrument_result_cache_limit"; |
There was a problem hiding this comment.
But here you want to enable some debug setting and later disable it, so for that here use "+d,fts_...", and below "-d,fts_..."
There was a problem hiding this comment.
Done, removed.
| # Must have debug code to use SET SESSION debug | ||
| --source include/have_debug.inc | ||
|
|
||
| create table `t1` ( |
There was a problem hiding this comment.
Consistent case for SQL keywords, suggesting uppercase
| !select_lex->materialized_table_count) | ||
| { | ||
| init_ftfuncs(thd, select_lex, order); | ||
| if (init_ftfuncs(thd, select_lex, order)) |
There was a problem hiding this comment.
All the other callers of init_ftfuncs do not check its return code - are they affected by this bug?
There was a problem hiding this comment.
They were. This was fixed in 5.7 by bug fix:21140111. I have ported this bug into 5.6. The bug fix is not completely correct - needed to move check for errors from init_ftfuncs bit higher in sql_delete.cc, otherwise error from init_ftfuncs caused assertion problem.
d419459 to
a1811e2
Compare
The problem here is missing error check in Item_func_match::init_search() after the handler call ft_init_ext_with_hints(), and missing error propagation in the call stack. The fix also includes a new inlined query block property function has_ft_funcs() that is used to avoid an unnecessary and costly function call to optimize full-text searches. (cherry picked from commit e78f3cb)
laurynas-biveinis
left a comment
There was a problem hiding this comment.
Er, no, please check Jenkins results - the debug build crashes constantly
a1811e2 to
4c4b851
Compare
|
Jenkins run => http://jenkins.percona.com/job/percona-server-5.6-param/1641/ There are some tests failing, but I have run them locally and all pass fine. |
| @@ -0,0 +1,55 @@ | |||
| --echo # | |||
There was a problem hiding this comment.
Shouldn't this test be put into innod_fts test suite rather than innodb?
| `text_content` MEDIUMTEXT, PRIMARY KEY (`FTS_DOC_ID`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
|
|
||
| CREATE UNIQUE INDEX FTS_DOC_ID_INDEX ON t1(FTS_DOC_ID); |
There was a problem hiding this comment.
Is additional index really needed? FTS_DOC_ID is already the primary key.
There was a problem hiding this comment.
This is taken from here: https://dev.mysql.com/doc/refman/5.6/en/optimizing-innodb-bulk-data-loading.html . To speed up the inserts.
| DELETE FROM t1 | ||
| WHERE MATCH text_content AGAINST ('+some_text_1234' IN BOOLEAN MODE); | ||
|
|
||
| SET GLOBAL innodb_ft_result_cache_limit=default; |
There was a problem hiding this comment.
Store @@global.innodb_ft_result_cache_limit at the beginning of the test and restore it here.
| && rbt_size(query->doc_ids) <= n_doc_ids)); | ||
| } | ||
| } else if (query->intersection != NULL) { | ||
| fts_query_free_intersection(query); |
| } | ||
| } else if (query->intersection != NULL) { | ||
| fts_query_free_intersection(query); | ||
| } |
4c4b851 to
e85f501
Compare
| --source include/have_innodb.inc | ||
| --source include/have_debug.inc | ||
|
|
||
| SET @saved_innodb_ft_result_cache_limit= @@innodb_ft_result_cache_limit; |
There was a problem hiding this comment.
You need to save GLOBAL variable here, e.g.
SET @saved_innodb_ft_result_cache_limit= @@global.innodb_ft_result_cache_limit;| query->total_size -= SIZEOF_RBT_CREATE; | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
InnoDB code (everything in storage/innobase*) requires InnoDB-style code formatting:
- Tab characters must be used for indentation
- Blocks must be indented by 1 tab
- 1 tab = 8 spaces (set this in your editor)
SQL code (for instance sql/* and include/*) requires MySQL-style code formatting:
- Using spaces only for indentation.
- Blocks must be indented by 2 spaces.
The bug was caused by three problems: 1) query->intersection was not freed in case of error caused by exceeding innodb_ft_result_cache_limit. 2) errors from init_ftfuncs were not propagated - this was fixed in 5.7 by bug fix 21140111. This was ported into 5.6 3) bug fix 21140111 was causing assertion failure when innodb_ft_result_cache was exceeded in DELETE command. This was also fixed.
e85f501 to
ef2c0bc
Compare
Summary: Add ddst_dict_init handler api support for rocksdb dd Currently rocksdb ddst_dict_init() doesn't add any rocksdb specific tables and tablespace during ddse initialize. Pull Request resolved: facebook/mysql-5.6#1297 Test Plan: CI Differential Revision: D46700996 fbshipit-source-id: fbb80035b54cc068c845e63fe6903c8488fce1d3
Summary: Add ddst_dict_init handler api support for rocksdb dd Currently rocksdb ddst_dict_init() doesn't add any rocksdb specific tables and tablespace during ddse initialize. Pull Request resolved: facebook/mysql-5.6#1297 Test Plan: CI Differential Revision: D46700996 fbshipit-source-id: fbb80035b54cc068c845e63fe6903c8488fce1d3
No test case for this bug as it is very time and resource consuming.