xtrabackup_checkpoints is a snowflake
.. there is magic that excludes xtrabackup_checkpoints from compression during a backup, but the same rules are not applied to encryption.
In the docs, we have:
This option accepts a string argument that specifies the directory in which to save an extra copy of the xtrabackup_checkpoints file. It is passed directly to xtrabackup's --extra-lsndir option. See the xtrabackup documentation for details.
If you read that as it is, this implies that if you don't use this option then the file is treated just like any other during the backup, which is not the case.
Since xtrabackup is capable of compressing/decompressing and encrypting/decrypting files itself, without any external commands run by the operator, it would seem that the correct solution for this specific file is:
- compress it if compressing other files
- encrypt it if encrypting other files
- automatically detect that it is compressed/encrypted if using for an incremental backup