MDEV-21903 FTS optimize thread aborts during shutdown

- This issue was caused by 5e62b6a5.
fts_optimize_callback() should free fts_optimize_wq and make it as NULL
when it receives FTS_MSG_STOP message. So that subsequent
fts_optimize_callback() doesn't fail with segmentation fault.
parent e74c1c9e
...@@ -2936,6 +2936,9 @@ static void fts_optimize_callback(void *) ...@@ -2936,6 +2936,9 @@ static void fts_optimize_callback(void *)
ib_vector_free(fts_slots); ib_vector_free(fts_slots);
fts_slots = NULL; fts_slots = NULL;
ib_wqueue_free(fts_optimize_wq);
fts_optimize_wq = NULL;
innobase_destroy_background_thd(fts_opt_thd); innobase_destroy_background_thd(fts_opt_thd);
ib::info() << "FTS optimize thread exiting."; ib::info() << "FTS optimize thread exiting.";
...@@ -3023,8 +3026,6 @@ fts_optimize_shutdown() ...@@ -3023,8 +3026,6 @@ fts_optimize_shutdown()
os_event_wait(fts_opt_shutdown_event); os_event_wait(fts_opt_shutdown_event);
os_event_destroy(fts_opt_shutdown_event); os_event_destroy(fts_opt_shutdown_event);
ib_wqueue_free(fts_optimize_wq);
fts_optimize_wq = NULL;
fts_opt_thd = NULL; fts_opt_thd = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment