File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1775,6 +1775,17 @@ static void trx_release_impl_and_expl_locks(trx_t *trx, bool serialised) {
1775
1775
bool trx_sys_latch_is_needed =
1776
1776
(trx->id > 0 ) || trx_state_eq (trx, TRX_STATE_PREPARED);
1777
1777
1778
+ /* Check and get GTID to be persisted. Do it outside mutex. It must be done
1779
+ before trx->state is changed to TRX_STATE_COMMITTED_IN_MEMORY, because the
1780
+ gtid_persistor.get_gtid_info() calls gtid_persistor.has_gtid() which checks
1781
+ if trx->state is TRX_STATE_PREPARED when thd == nullptr, and updates the thd
1782
+ with thd_get_current_thd() in such case. */
1783
+ Gtid_desc gtid_desc;
1784
+ if (serialised) {
1785
+ auto >id_persistor = clone_sys->get_gtid_persistor ();
1786
+ gtid_persistor.get_gtid_info (trx, gtid_desc);
1787
+ }
1788
+
1778
1789
if (trx_sys_latch_is_needed) {
1779
1790
trx_sys_mutex_enter ();
1780
1791
}
@@ -1823,11 +1834,6 @@ static void trx_release_impl_and_expl_locks(trx_t *trx, bool serialised) {
1823
1834
become purged (because trx->no would no longer protect them). */
1824
1835
1825
1836
if (serialised) {
1826
- /* Check and get GTID to be persisted. Do it outside mutex. */
1827
- Gtid_desc gtid_desc;
1828
- auto >id_persistor = clone_sys->get_gtid_persistor ();
1829
- gtid_persistor.get_gtid_info (trx, gtid_desc);
1830
-
1831
1837
trx_sys_serialisation_mutex_enter ();
1832
1838
1833
1839
/* Add GTID to be persisted to disk table. It must be done ...
You can’t perform that action at this time.
0 commit comments