summaryrefslogtreecommitdiff
path: root/sql/wsrep_xid.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-05-31 20:37:00 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2016-05-31 20:37:00 -0400
commitde7eafc7ce1af2f61952f6d0efb41c408c2765c6 (patch)
tree830ac44a78c0670532b74be92f096d1f5c273d67 /sql/wsrep_xid.cc
parenteb86c32225db2a76c6f256130e7bb316900a9408 (diff)
downloadmariadb-git-de7eafc7ce1af2f61952f6d0efb41c408c2765c6.tar.gz
MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno
- Validate the specified wsrep_start_position value by also checking the return status of wsrep->sst_received. This also ensures that changes in wsrep_start_position is not allowed when the node is not in JOINING state. - Do not allow decrease in seqno within same UUID. - The initial checkpoint in SEs should be [0...:-1].
Diffstat (limited to 'sql/wsrep_xid.cc')
-rw-r--r--sql/wsrep_xid.cc30
1 files changed, 20 insertions, 10 deletions
diff --git a/sql/wsrep_xid.cc b/sql/wsrep_xid.cc
index 133e9cba825..876f791da69 100644
--- a/sql/wsrep_xid.cc
+++ b/sql/wsrep_xid.cc
@@ -89,16 +89,17 @@ static my_bool set_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg)
return FALSE;
}
-void wsrep_set_SE_checkpoint(XID& xid)
+bool wsrep_set_SE_checkpoint(XID& xid)
{
- plugin_foreach(NULL, set_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN, &xid);
+ return plugin_foreach(NULL, set_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN,
+ &xid);
}
-void wsrep_set_SE_checkpoint(const wsrep_uuid_t& uuid, wsrep_seqno_t seqno)
+bool wsrep_set_SE_checkpoint(const wsrep_uuid_t& uuid, wsrep_seqno_t seqno)
{
XID xid;
wsrep_xid_init(&xid, uuid, seqno);
- wsrep_set_SE_checkpoint(xid);
+ return wsrep_set_SE_checkpoint(xid);
}
static my_bool get_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg)
@@ -118,12 +119,13 @@ static my_bool get_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg)
return FALSE;
}
-void wsrep_get_SE_checkpoint(XID& xid)
+bool wsrep_get_SE_checkpoint(XID& xid)
{
- plugin_foreach(NULL, get_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN, &xid);
+ return plugin_foreach(NULL, get_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN,
+ &xid);
}
-void wsrep_get_SE_checkpoint(wsrep_uuid_t& uuid, wsrep_seqno_t& seqno)
+bool wsrep_get_SE_checkpoint(wsrep_uuid_t& uuid, wsrep_seqno_t& seqno)
{
uuid= WSREP_UUID_UNDEFINED;
seqno= WSREP_SEQNO_UNDEFINED;
@@ -132,16 +134,24 @@ void wsrep_get_SE_checkpoint(wsrep_uuid_t& uuid, wsrep_seqno_t& seqno)
memset(&xid, 0, sizeof(xid));
xid.formatID= -1;
- wsrep_get_SE_checkpoint(xid);
+ if (wsrep_get_SE_checkpoint(xid))
+ {
+ return true;
+ }
- if (xid.formatID == -1) return; // nil XID
+ if (xid.formatID == -1) // nil XID
+ {
+ return false;
+ }
if (!wsrep_is_wsrep_xid(&xid))
{
WSREP_WARN("Read non-wsrep XID from storage engines.");
- return;
+ return false;
}
uuid= *wsrep_xid_uuid(xid);
seqno= wsrep_xid_seqno(xid);
+
+ return false;
}