File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -201,25 +201,21 @@ extern "C" void wsrep_handle_SR_rollback(THD *bf_thd,
201
201
victim_thd->wsrep_sr ().fragments_certified (),
202
202
wsrep_thd_transaction_state_str (victim_thd));
203
203
204
- /* Note: do not store/reset globals before wsrep_bf_abort() call
205
- to avoid losing BF thd context. */
206
- if (!(bf_thd && bf_thd != victim_thd))
204
+ const bool self_abort= (!bf_thd || bf_thd == victim_thd);
205
+ if (self_abort)
207
206
{
207
+ /* Don't hold the lock in sync wait. wsrep_thd_self_abort() grabs
208
+ the same lock again before performing BF abort. */
209
+ wsrep_thd_UNLOCK (victim_thd);
208
210
DEBUG_SYNC (victim_thd, " wsrep_before_SR_rollback" );
209
- }
210
- if (bf_thd)
211
- {
212
- wsrep_bf_abort (bf_thd, victim_thd);
213
- }
214
- else
215
- {
216
211
wsrep_thd_self_abort (victim_thd);
217
212
}
218
-
219
- wsrep_thd_UNLOCK (victim_thd);
220
-
221
- if (bf_thd)
213
+ else
222
214
{
215
+ /* Note: do not store/reset globals before wsrep_bf_abort() call
216
+ to avoid losing BF thd context. */
217
+ wsrep_bf_abort (bf_thd, victim_thd);
218
+ wsrep_thd_UNLOCK (victim_thd);
223
219
wsrep_store_threadvars (bf_thd);
224
220
}
225
221
}
You can’t perform that action at this time.
0 commit comments