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 @@ -132,6 +132,11 @@ bool Session_consistency_gtids_ctx::notify_after_gtid_executed_update(
132
132
return res;
133
133
}
134
134
135
+ void Session_consistency_gtids_ctx::
136
+ update_tracking_activeness_from_session_variable (const THD *thd) {
137
+ m_curr_session_track_gtids = thd->variables .session_track_gtids ;
138
+ }
139
+
135
140
bool Session_consistency_gtids_ctx::notify_after_response_packet (
136
141
const THD *thd) {
137
142
int res = false ;
@@ -144,7 +149,7 @@ bool Session_consistency_gtids_ctx::notify_after_response_packet(
144
149
this value. It may have changed (the previous command may have been
145
150
a SET SESSION session_track_gtids=...;).
146
151
*/
147
- m_curr_session_track_gtids = thd-> variables . session_track_gtids ;
152
+ update_tracking_activeness_from_session_variable ( thd) ;
148
153
return res;
149
154
}
150
155
@@ -162,7 +167,7 @@ void Session_consistency_gtids_ctx::register_ctx_change_listener(
162
167
if the session_track_gtids value is set at startup time to anything
163
168
different than OFF.
164
169
*/
165
- m_curr_session_track_gtids = thd-> variables . session_track_gtids ;
170
+ update_tracking_activeness_from_session_variable ( thd) ;
166
171
}
167
172
}
168
173
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