This feature is quite useful to obtain logical backups with correct positions without running a FLUSHTABLESWITHREADLOCK. Binary log position can be obtained by two newly implemented status variables: Binlog_snapshot_file and Binlog_snapshot_position. After starting a transaction using the STARTTRANSACTIONWITHCONSISTENTSNAPSHOT, these two variables will provide you with the binlog position corresponding to the state of the database of the consistent snapshot so taken, irrespectively of which other transactions have been committed since the snapshot was taken.

The Percona Server implementation extends the STARTTRANSACTIONWITHCONSISTENTSNAPSHOT syntax with the optional FROMSESSION clause:

STARTTRANSACTIONWITHCONSISTENTSNAPSHOTFROMSESSION<session_id>;

When specified, all participating storage engines and binary log instead of creating a new snapshot of data (or binary log coordinates), create a copy of the snapshot which has been created by an active transaction in the specified session. session_id is the session identifier reported in the Id column of SHOWPROCESSLIST.

Currently snapshot cloning is only supported by XtraDB and the binary log. As with the regular STARTTRANSACTIONWITHCONSISTENTSNAPSHOT, snapshot clones can only be created with the REPEATABLEREAD isolation level.

For XtraDB, a transaction with a cloned snapshot will only see data visible or changed by the donor transaction. That is, the cloned transaction will see no changes committed by transactions that started after the donor transaction, not even changes made by itself. Note that in case of chained cloning the donor transaction is the first one in the chain. For example, if transaction A is cloned into transaction B, which is in turn cloned into transaction C, the latter will have read view from transaction A (i.e. the donor transaction). Therefore, it will see changes made by transaction A, but not by transaction B.

mysqldump has been updated to use new status variables automatically when they are supported by the server and both --single-transaction and --master-data are specified on the command line. Along with the mysqldump improvements introduced in Backup Locks there is now a way to generate mysqldump backups that are guaranteed to be consistent without using FLUSHTABLESWITHREADLOCK even if --master-data is requested.

This server variable is implemented to help other utilities detect if the server supports the FROMSESSION extension. When available, the snapshot cloning feature and the syntax extension to STARTTRANSACTIONWITHCONSISTENTSNAPSHOT are supported by the server, and the variable value is always YES.