Skip to content

Commit acce1f3

Browse files
author
Jan Lindström
committed
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.
1 parent 935a1c6 commit acce1f3

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

storage/innobase/fil/fil0crypt.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,11 @@ fil_crypt_complete_rotate_space(
22582258
crypt_data->rotate_state.flushing = false;
22592259
mutex_exit(&crypt_data->mutex);
22602260
}
2261+
} else {
2262+
mutex_enter(&crypt_data->mutex);
2263+
ut_a(crypt_data->rotate_state.active_threads > 0);
2264+
crypt_data->rotate_state.active_threads--;
2265+
mutex_exit(&crypt_data->mutex);
22612266
}
22622267
}
22632268

storage/xtradb/fil/fil0crypt.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,11 @@ fil_crypt_complete_rotate_space(
22582258
crypt_data->rotate_state.flushing = false;
22592259
mutex_exit(&crypt_data->mutex);
22602260
}
2261+
} else {
2262+
mutex_enter(&crypt_data->mutex);
2263+
ut_a(crypt_data->rotate_state.active_threads > 0);
2264+
crypt_data->rotate_state.active_threads--;
2265+
mutex_exit(&crypt_data->mutex);
22612266
}
22622267
}
22632268

@@ -2543,8 +2548,9 @@ fil_space_crypt_close_tablespace(
25432548

25442549
if (now >= last + 30) {
25452550
ib_logf(IB_LOG_LEVEL_WARN,
2546-
"Waited %ld seconds to drop space: %s(" ULINTPF ").",
2547-
now - start, space->name, space->id);
2551+
"Waited %ld seconds to drop space: %s (" ULINTPF
2552+
") active threads %u flushing=%d.",
2553+
now - start, space->name, space->id, cnt, flushing);
25482554
last = now;
25492555
}
25502556
}

0 commit comments

Comments
 (0)