File tree 3 files changed +16
-2
lines changed
3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,16 @@ namespace wsrep
194
194
*/
195
195
virtual bool is_explicit_xa () = 0;
196
196
197
+ /* *
198
+ * Returns true if the client has an ongoing XA transaction
199
+ * in prepared state.
200
+ * Notice: one could simply check if wsrep::transaction is
201
+ * in s_prepared state. However, wsrep::transaction does not
202
+ * transition to prepared state for read-only / empty
203
+ * transactions.
204
+ */
205
+ virtual bool is_prepared_xa () = 0;
206
+
197
207
/* *
198
208
* Returns true if the currently executing command is
199
209
* a rollback for XA. This is used to avoid setting a
Original file line number Diff line number Diff line change @@ -68,8 +68,7 @@ void wsrep::client_state::close()
68
68
keep_command_error_ = false ;
69
69
lock.unlock ();
70
70
if (transaction_.active () &&
71
- (mode_ != m_local ||
72
- transaction_.state () != wsrep::transaction::s_prepared))
71
+ (mode_ != m_local || !client_service_.is_prepared_xa ()))
73
72
{
74
73
client_service_.bf_rollback ();
75
74
transaction_.after_statement ();
Original file line number Diff line number Diff line change @@ -176,6 +176,11 @@ namespace wsrep
176
176
return false ;
177
177
}
178
178
179
+ bool is_prepared_xa () WSREP_OVERRIDE
180
+ {
181
+ return false ;
182
+ }
183
+
179
184
bool is_xa_rollback () WSREP_OVERRIDE
180
185
{
181
186
return false ;
You can’t perform that action at this time.
0 commit comments