There is one additional consideration for 10.8 and later releases. Quoting a comment in MDEV-14425:
An observation was made during testing: rr record mariadb-backup --backup cannot work reliably if the redo log file was opened via mmap(). The reason is that rr assumes that the mmap file contents may only be changed by the traced process(es). To avoid bogus failures while running backup under rr, there are a few solutions:
- Build without libpmem: rm CMakeCache.txt; cmake -DCMAKE_DISABLE_FIND_PACKAGE_PMEM=1 /path/to/source
- Place the server’s redo log somewhere else than /dev/shm or a PMEM device mounted with -o dax.
- Patch log_t::attach() so that mmap() will not be attempted if srv_operation == SRV_OPERATION_BACKUP.
- Implement server-side backup (MDEV-14992).
One more (probably impractical) alternative would be to trace both the server and the backup process in a single rr record process.
this should be implemented in My::Debugger and work for all debuggers and all tools ($MYSQL, etc)