File tree 3 files changed +17
-2
lines changed 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,11 @@ bool Session_consistency_gtids_ctx::notify_after_gtid_executed_update(
133
133
return res;
134
134
}
135
135
136
+ void Session_consistency_gtids_ctx::
137
+ update_tracking_activeness_from_session_variable (const THD *thd) {
138
+ m_curr_session_track_gtids = thd->variables .session_track_gtids ;
139
+ }
140
+
136
141
bool Session_consistency_gtids_ctx::notify_after_response_packet (
137
142
const THD *thd) {
138
143
int res = false ;
@@ -145,7 +150,7 @@ bool Session_consistency_gtids_ctx::notify_after_response_packet(
145
150
this value. It may have changed (the previous command may have been
146
151
a SET SESSION session_track_gtids=...;).
147
152
*/
148
- m_curr_session_track_gtids = thd-> variables . session_track_gtids ;
153
+ update_tracking_activeness_from_session_variable ( thd) ;
149
154
return res;
150
155
}
151
156
@@ -163,7 +168,7 @@ void Session_consistency_gtids_ctx::register_ctx_change_listener(
163
168
if the session_track_gtids value is set at startup time to anything
164
169
different than OFF.
165
170
*/
166
- m_curr_session_track_gtids = thd-> variables . session_track_gtids ;
171
+ update_tracking_activeness_from_session_variable ( thd) ;
167
172
}
168
173
}
169
174
Original file line number Diff line number Diff line change @@ -201,6 +201,11 @@ class Session_consistency_gtids_ctx {
201
201
return notify_after_transaction_commit (thd);
202
202
}
203
203
204
+ /* *
205
+ Update session tracker (m_curr_session_track_gtids) from thd.
206
+ */
207
+ void update_tracking_activeness_from_session_variable (const THD *thd);
208
+
204
209
private:
205
210
// not implemented
206
211
Session_consistency_gtids_ctx (const Session_consistency_gtids_ctx &rsc);
Original file line number Diff line number Diff line change @@ -3815,6 +3815,11 @@ void set_slave_thread_options(THD *thd) {
3815
3815
thd->variables .option_bits = options;
3816
3816
thd->variables .completion_type = 0 ;
3817
3817
3818
+ /* Do not track GTIDs for slave threads to avoid performance issues. */
3819
+ thd->variables .session_track_gtids = OFF;
3820
+ thd->rpl_thd_ctx .session_gtids_ctx ()
3821
+ .update_tracking_activeness_from_session_variable (thd);
3822
+
3818
3823
/*
3819
3824
Set autocommit= 1 when info tables are used and autocommit == 0 to
3820
3825
avoid trigger asserts on mysql_execute_command(THD *thd) caused by
You can’t perform that action at this time.
0 commit comments