diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-05-01 09:03:07 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-05-01 09:03:07 +0300 |
commit | 716b49d2a7e0bea65656582e69d12199509c7193 (patch) | |
tree | 5f32f755129f8d82526baba700f2a5a208b0f47f | |
parent | 935a1c676e1fbfea7950d69c410a59a29a50857a (diff) | |
download | mariadb-git-bb-10.1-12624.tar.gz |
MDEV-12624: encryption.innodb_encryption_tables fails in buildbot withbb-10.1-12624
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.
-rw-r--r-- | storage/innobase/fil/fil0crypt.cc | 5 | ||||
-rw-r--r-- | storage/xtradb/fil/fil0crypt.cc | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 1d9dc50d73f..f32a8fc7608 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -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); } } diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index 14b6bd1306d..8c388303070 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -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; } } |