summaryrefslogtreecommitdiff
path: root/sql/wsrep_hton.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2014-10-08 13:30:45 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2014-10-08 13:30:45 -0400
commit7dd74fa3a2f167424624bf71d54ff965514239a9 (patch)
treed3111676dd0d4d52041bc33c0bb4a9b26ca59eca /sql/wsrep_hton.cc
parentb197066ca02411455590249c5e4910ad5ef2bd9f (diff)
downloadmariadb-git-7dd74fa3a2f167424624bf71d54ff965514239a9.tar.gz
MDEV-6481: Yum Upgrade on CentOS 6.5 causes instantmariadb-galera-10.0.14
crash of MariaDB/Galera mysqld crashes during startup when its started with --wsrep-recover (mysqld_safe.sh). The problem was that during server startup "wsrep" handle is not initialized for --wsrep-recover and since the condition to register wsrep hton depended only on 'wsrep_on' global/session variables (WSREP(thd) macro), it can eventually get registered and calls to wsrep handle's functions (commit, rollback, etc.) can be made (SIGSEGV!). Fixed by adding a check for "wsrep" pointer in WSREP(thd) macro (added by lp:1367173). Additionally, a check for WSREP(thd) (instead of checking the availability of wsrep provider) has been added before invoking wsrep handle's commit & rollback functions.
Diffstat (limited to 'sql/wsrep_hton.cc')
-rw-r--r--sql/wsrep_hton.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index 48577a9b5a1..86a0b6e1ece 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -210,9 +210,9 @@ static int wsrep_rollback(handlerton *hton, THD *thd, bool all)
}
if ((all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
- (thd->variables.wsrep_on && thd->wsrep_conflict_state != MUST_REPLAY))
+ thd->wsrep_conflict_state != MUST_REPLAY)
{
- if (wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle))
+ if (WSREP(thd) && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle))
{
DBUG_PRINT("wsrep", ("setting rollback fail"));
WSREP_ERROR("settting rollback fail: thd: %llu SQL: %s",
@@ -252,13 +252,11 @@ int wsrep_commit(handlerton *hton, THD *thd, bool all)
Transaction didn't go through wsrep->pre_commit() so just roll back
possible changes to clean state.
*/
- if (WSREP_PROVIDER_EXISTS) {
- if (wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle))
- {
- DBUG_PRINT("wsrep", ("setting rollback fail"));
- WSREP_ERROR("settting rollback fail: thd: %llu SQL: %s",
- (long long)thd->real_id, thd->query());
- }
+ if (WSREP(thd) && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle))
+ {
+ DBUG_PRINT("wsrep", ("setting rollback fail"));
+ WSREP_ERROR("settting rollback fail: thd: %llu SQL: %s",
+ (long long)thd->real_id, thd->query());
}
wsrep_cleanup_transaction(thd);
}