Scrubbing tests somehow got encryption enabled in their opt files. After removing --innodb-encrypt-tables=ON and --innodb-encrypt-log=ON from innodb_scrub.opt, innodb_scrub_background.opt, innodb_scrub_compressed.opt, these tests start to fail.
Now that the problematic ‘background scrubbing’ and all scrubbing code that incorrectly skipped redo logging has been removed from MariaDB Server 10.5.2, we should continue where
MDEV-15528 left off, and finally enable the scrubbing tests to prove that the theoretically sound way of scrubbing actually works:
- Remove the invalidate parameter of btr_free_root()
- Introduce a data structure that allows us to mark a range of data pages of a tablespace as freed, even when those pages are not in the buffer pool. This could be attached to fil_space_t.
- Ensure that crash recovery will replay the FREE_PAGE records (extend the above mentioned ranges of freed pages), and punch holes in page_compressed tables, or overwrite blocks with zeroes if innodb_immediate_scrub_data_uncompressed is set.
- On page flush, try to combine large punch_hole or zero-initialization requests to a small one.
- Optional: when freeing the last pages of a tablespace, write a TRIM_PAGES record, and on page flush, invoke ftruncate() to shrink the file. (Do this on any file, when neither scrubbing nor page_compressed is being used.)