WiredTiger currently allocates a transaction ID when an application makes a "non-transactional update". This is required so that such updates are not visible to concurrent transactions running at snapshot isolation.
However, this behavior causes some problems. Firstly, a new ID is allocated if the session does not have the most recent ID, so multiple threads performing non-transactional updates will cause IDs to be allocated quickly.
Secondly, a session should always see its own updates. This is not straightforward if there is an active snapshot when the transaction allocates a new ID – the snapshot does not contain the new ID, and there is no easy way to add it. The current code has a "workaround" in __wt_txn_is_visible, but it is not sufficient.
Lastly, if a logical update operation touches multiple files, the updates should be grouped together. They should become visible atomically, and ideally should be rolled back if the update fails part-way through.
The best way to fix all of this would be to do real auto-commit of transactions in cursor update operations, at the API layer. The obvious place to do this is in the CURSOR_API_* macros, but some care is required to export an interface that extensions could use to implement their own cursors.
- is related to
-
WT-331 Autocommit
- Closed