MDEV-33770 Alter operation hangs when encryption thread works on the same tablespace

- Background encryption threads wait for stop flag
to exit early from the tablespace. Alter operation
fails to set the stop flag before waiting for the
encryption thread to stop using the tablespace.
parent d695e2de
......@@ -2755,7 +2755,7 @@ fil_space_crypt_close_tablespace(
<< " seconds to drop space: "
<< space->name << " ("
<< space->id << ") active threads "
<< cnt << "flushing="
<< cnt << " flushing="
<< flushing << ".";
last = now;
}
......
......@@ -2288,13 +2288,13 @@ fil_check_pending_operations(
fil_space_t* sp = fil_space_get_by_id(id);
if (sp) {
sp->set_stopping(true);
if (sp->crypt_data && sp->acquire()) {
mutex_exit(&fil_system.mutex);
fil_space_crypt_close_tablespace(sp);
mutex_enter(&fil_system.mutex);
sp->release();
}
sp->set_stopping(true);
}
/* Check for pending operations. */
......
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