diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-01-21 17:02:13 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-01-21 17:02:13 +0530 |
commit | 22a15eb42589f98fdc305e04ab297a880f1c39ca (patch) | |
tree | db5f7abff82bb1de30fcf51f0ac6f56aa6bc0811 | |
parent | fa14c423cd1439dfeae3067449d9ac8d190d350e (diff) | |
download | mariadb-git-bb-10.6-MDEV-24637.tar.gz |
MDEV-24637 fts_slots is being accessed after it gets freedbb-10.6-MDEV-24637
fts_optimize_callback() could be called after processing
FTS_MSG_STOP due to timer initiated callback. This issue
is caused by commit 38fd7b7d9170369b16ff553f01669182e70bc9b5
(MDEV-21452). In that case, fts_optimize_callback() should
check whether it processed FTS_MSG_STOP already.
Reviewed-by: Marko Mäkelä
-rw-r--r-- | storage/innobase/fts/fts0opt.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index ed9bfa58333..11dcbc0a767 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -2797,15 +2797,16 @@ static void fts_optimize_callback(void *) { ut_ad(!srv_read_only_mode); - if (!fts_optimize_wq) { + static ulint current; + static bool done; + static ulint n_optimize; + + if (!fts_optimize_wq || done) { /* Possibly timer initiated callback, can come after FTS_MSG_STOP.*/ return; } - static ulint current = 0; - static ibool done = FALSE; static ulint n_tables = ib_vector_size(fts_slots); - static ulint n_optimize = 0; while (!done && srv_shutdown_state <= SRV_SHUTDOWN_INITIATED) { /* If there is no message in the queue and we have tables @@ -2846,7 +2847,7 @@ static void fts_optimize_callback(void *) switch (msg->type) { case FTS_MSG_STOP: - done = TRUE; + done = true; break; case FTS_MSG_ADD_TABLE: |