Commit d051f6c3 authored by Nirbhay Choubey's avatar Nirbhay Choubey

MDEV-6594: Use separate domain_id for Galera transactions

Post-fix : A typo and better error handling.
parent a1f3356b
...@@ -451,7 +451,7 @@ static void* sst_joiner_thread (void* a) ...@@ -451,7 +451,7 @@ static void* sst_joiner_thread (void* a)
} else { } else {
// Scan state ID first followed by wsrep_gtid_domain_id. // Scan state ID first followed by wsrep_gtid_domain_id.
char uuid[512]; char uuid[512];
uint32 domain_id; long int domain_id;
size_t len= pos - out + 1; size_t len= pos - out + 1;
if (len > sizeof(uuid)) goto err; // safety check if (len > sizeof(uuid)) goto err; // safety check
...@@ -464,14 +464,18 @@ static void* sst_joiner_thread (void* a) ...@@ -464,14 +464,18 @@ static void* sst_joiner_thread (void* a)
} }
else if (wsrep_gtid_mode) else if (wsrep_gtid_mode)
{ {
errno= 0; /* Reset the errno */
domain_id= strtol(pos + 1, NULL, 10); domain_id= strtol(pos + 1, NULL, 10);
if (domain_id < 1000 || domain_id > 0xFFFF) err= errno;
/* Check if we received a valid gtid_domain_id. */
if (err == EINVAL || err == ERANGE || domain_id < 0x0 || domain_id > 0xFFFF)
{ {
WSREP_ERROR("Failed to get donor wsrep_gtid_domain_id."); WSREP_ERROR("Failed to get donor wsrep_gtid_domain_id.");
err= EINVAL; err= EINVAL;
goto err; goto err;
} else { } else {
wsrep_gtid_domain_id= domain_id; wsrep_gtid_domain_id= (uint32) domain_id;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment