mysqlnd_ms_xa_gc
(PECL mysqlnd_ms < 1.6.0)
mysqlnd_ms_xa_gc — Garbage collects unfinished XA transactions after severe errors
Description
Garbage collects unfinished XA transactions.
The XA protocol is a blocking protocol. There exist cases when servers participating in a global transaction cannot make progress when the transaction coordinator crashes or disconnects. In such a case, the MySQL servers keep waiting for instructions to finish the XA transaction in question. Because transactions occupy resources, transactions should always be terminated properly.
Garbage collection requires configuring a state store to track global transactions. Should a PHP client crash in the middle of a transaction and a new PHP client be started, then the built-in garbage collection can learn about the aborted global transaction and terminate it. If you do not configure a state store, the garbage collection cannot perform any cleanup tasks.
The state store should be crash-safe and be highly available to survive its own crash. Currently, only MySQL is supported as a state store.
Garbage collection can also be performed automatically in the background. See the plugin configuration directive garbage_collection for details.
Note: Experimental
The feature is currently under development. There may be issues and/or feature limitations. Do not use in production environments.
Parameters
-
connection
-
A MySQL connection handle obtained from any of the connect functions of the mysqli, mysql or PDO_MYSQL extensions.
-
gtrid
-
Global transaction identifier (gtrid). If given, the garbage collection considers the transaction only. Otherwise, the state store is scanned for any unfinished transaction.
-
ignore_max_retries
-
Whether to ignore the plugin configuration max_retries setting. If garbage collection continuously fails and the max_retries limit is reached prior to finishing the failed global transaction, you can attempt further runs prior to investigating the cause and solving the issue manually by issuing appropriate SQL statements on the participants. Setting the parameter has the same effect as temporarily setting max_retries = 0.
See Also
- Quickstart XA/Distributed transactions
- Runtime configuration
- State store configuration
- mysqlnd_ms_get_stats() - Returns query distribution and connection statistics
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-function.mysqlnd-ms-xa-gc.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.