XtraDB/InnoDB data scrubbing
MariaDB starting with 10.1.4
The description below applies to MariaDB 10.1.4 and later
Sometimes there is a requirement that when some data is deleted, it is really gone. This might be the case when one stores personal information of users or some other sensitive data. Normally, though, when a row is deleted, the space is only marked as free on the page, it may be overwritten eventually, but there is no guarantee when it will happen. Also a copy of deleted rows may be present in the log files.
MariaDB 10.1.3 has introduced support for data scrubbing. Background threads periodically scans tablespaces and logs and removes all data that should be deleted. The number of background threads is set by innodb-encryption-threads. Log scrubbing happens in a separate thread.
To configure scrubbing one can use the following variables:
innodb-background-scrub-data-check-interval | Seconds | Check at this intervall if tablespaces needs scrubbing |
innodb-background-scrub-data-compressed | Boolean | Enable scrubbing of compressed data by background threads |
innodb-background-scrub-data-interval | Seconds | Scrub spaces that were last scrubbed longer than this many seconds ago. |
innodb-background-scrub-data-uncompressed | Boolean | Enable scrubbing of uncompressed data by background threads |
innodb-immediate-scrub-data-uncompressed | Boolean | Enable scrubbing of uncompressed data |
innodb-scrub-log | Boolean | Enable log scrubbing |
innodb-scrub-log-speed | Bytes/sec |
Thanks
- Scrubbing was donated to the MariaDB project by Google.