Commit acce1f37 authored by Jan Lindström's avatar Jan Lindström

MDEV-12624: encryption.innodb_encryption_tables fails in buildbot with timeout

This regression was caused by MDEV-12467 encryption.create_or_replace
hangs during DROP TABLE, where if table->is_stopping() (i.e. when
tablespace is dropped) background key rotation thread calls
fil_crypt_complete_rotate_space to release space and stop rotation.
However, that function does not decrease number of rotating
threads if table->is_stopping() is true.
parent 935a1c67
......@@ -2258,6 +2258,11 @@ fil_crypt_complete_rotate_space(
crypt_data->rotate_state.flushing = false;
mutex_exit(&crypt_data->mutex);
}
} else {
mutex_enter(&crypt_data->mutex);
ut_a(crypt_data->rotate_state.active_threads > 0);
crypt_data->rotate_state.active_threads--;
mutex_exit(&crypt_data->mutex);
}
}
......
......@@ -2258,6 +2258,11 @@ fil_crypt_complete_rotate_space(
crypt_data->rotate_state.flushing = false;
mutex_exit(&crypt_data->mutex);
}
} else {
mutex_enter(&crypt_data->mutex);
ut_a(crypt_data->rotate_state.active_threads > 0);
crypt_data->rotate_state.active_threads--;
mutex_exit(&crypt_data->mutex);
}
}
......@@ -2543,8 +2548,9 @@ fil_space_crypt_close_tablespace(
if (now >= last + 30) {
ib_logf(IB_LOG_LEVEL_WARN,
"Waited %ld seconds to drop space: %s(" ULINTPF ").",
now - start, space->name, space->id);
"Waited %ld seconds to drop space: %s (" ULINTPF
") active threads %u flushing=%d.",
now - start, space->name, space->id, cnt, flushing);
last = now;
}
}
......
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