The test case encryption.innodb_encrypt_freed is failing in MemorySanitizer builds:
This failure was initially observed on a 10.6-based branch. The cause of the failure is twofold: We were comparing the page contents before checking the status, but also recovery failed to flag the block as freed:
There are a few other places in the code where the BUF_GET_POSSIBLY_FREED mode is being used without a proper check afterwards. After fixing fil_crypt_rotate_page(), both uses of BUF_GET_IF_IN_POOL are safe.
Other affected functions are the following:
- btr_cur_optimistic_latch_leaves() (when acquiring a latch on the preceding page)
- fil_crypt_read_crypt_data(), fil_crypt_start_encrypting_space(), fil_crypt_flush_space() (in addition to fil_crypt_rotate_page())
- xdes_get_descriptor_const() (might affect change buffer merges and encryption)
- lock_rec_block_validate() (in debug builds only)
All in all, these race conditions mostly affect encryption. The impact of the issue is unclear but probably minimal except for encryption. If a bogus page is being written by encryption, crash recovery could fail with similar symptoms as
MDEV-24695. That would be 'caused' by MDEV-15528 and not affecting earlier major versions than 10.5.