Called after the transaction has been committed. Return zero on success, non-zero on failure. */
| 390 | Return zero on success, non-zero on failure. |
| 391 | */ |
| 392 | static inline int wsrep_after_commit(THD* thd, bool all) |
| 393 | { |
| 394 | DBUG_ENTER("wsrep_after_commit"); |
| 395 | WSREP_DEBUG("wsrep_after_commit: %d, %d, %lld, %d", |
| 396 | wsrep_is_real(thd, all), |
| 397 | wsrep_is_active(thd), |
| 398 | (long long)wsrep_thd_trx_seqno(thd), |
| 399 | wsrep_has_changes(thd)); |
| 400 | DBUG_ASSERT(wsrep_run_commit_hook(thd, all)); |
| 401 | if (thd->internal_transaction()) |
| 402 | DBUG_RETURN(0); |
| 403 | int ret= 0; |
| 404 | if (thd->wsrep_trx().state() == wsrep::transaction::s_committing) |
| 405 | { |
| 406 | ret= thd->wsrep_cs().ordered_commit(); |
| 407 | } |
| 408 | wsrep_unregister_from_group_commit(thd); |
| 409 | thd->wsrep_xid.null(); |
| 410 | DBUG_RETURN(ret || thd->wsrep_cs().after_commit()); |
| 411 | } |
| 412 | |
| 413 | /* |
| 414 | Called before the transaction is rolled back. |
no test coverage detected