Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
It would be very useful to be able to make a connection share the transaction snapshot of another connection that is already open and has started a consistent read transaction.
This would not allow them to share the set of modifications (ie. inserts/updates/deletes not yet committed) - just the same query snapshot. It could even be read-only.
If the transaction isolation levels are repeatable read, and no changes have been made, it means you can get perfectly consistent queries across the connections.
The motivation is that then we can do parallel SQL backup dumps, parallel database resyncs, and parallel reporting queries. I would use all three personally.
PostgreSQL 9.3 has introduced this feature using the function pg_export_snapshot to get the revision number and SET TRANSACTION SNAPSHOT <snapshot ID> to use it in another session (personally I think it would be more natural to pass it in the BEGIN/START TRANSACTION statement). They use it for parallel pg_dump which is good, but I would also use it in my apps as it is very hard to make full use of a modern database server with only one client thread and some big client jobs still take hours in a single thread.
From what I understand of how InnoDB works, I think this is doable? The engine status shows lines like this:
Trx read view will not see trx with id >= 1CE54868, sees < 1CE54864
So we would need to be able to copy those values across to another connection/transaction.
Thoughts?
Attachments
Issue Links
- relates to
-
MDEV-6096 Ideas about parallel query execution
- Open
-
MDEV-14090 XA START must be WITH CONSISTENT SNAPSHOT
- Open
-
MDEV-16610 Torn reads from spider, with XA and isolation level REPEATABLE READ
- Open
-
MDEV-33446 optimizer is wrong
- Open