MDEV-24190 Accessing INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION may break innodb_open_files logic

If the function i_s_tablespaces_encryption_fill_table() was not able to
report all content to the SQL layer, it would fail to decrement
fil_system.freeze_space_list that it had incremented. This would
prevent the not-frequently-used logic from working, potentially causing
frequently used files to be closed and reopened whenever innodb_open_files
is exceeded.

This regression was caused by
commit 45ed9dd957eebc7fc84feb2509f4aa6baa908a95 (part of MDEV-23855).
This commit is contained in:
Marko Mäkelä 2020-11-11 09:11:34 +02:00
parent 10b2d5726f
commit e9b3d44c6e

View File

@ -7049,6 +7049,7 @@ i_s_tablespaces_encryption_fill_table(
DBUG_RETURN(0);
}
int err = 0;
mutex_enter(&fil_system.mutex);
fil_system.freeze_space_list++;
@ -7058,19 +7059,19 @@ i_s_tablespaces_encryption_fill_table(
&& !space->is_stopping()) {
space->reacquire();
mutex_exit(&fil_system.mutex);
if (int err = i_s_dict_fill_tablespaces_encryption(
thd, space, tables->table)) {
space->release();
DBUG_RETURN(err);
}
err = i_s_dict_fill_tablespaces_encryption(
thd, space, tables->table);
mutex_enter(&fil_system.mutex);
space->release();
if (err) {
break;
}
}
}
fil_system.freeze_space_list--;
mutex_exit(&fil_system.mutex);
DBUG_RETURN(0);
DBUG_RETURN(err);
}
/*******************************************************************//**
Bind the dynamic table INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION