Remove error handling from wsrep_sync_wait()

Let the wsrep-lib error be set/overriden at the end of
dispatch_command().

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
This commit is contained in:
Daniele Sciascia 2024-12-11 17:35:53 +01:00 committed by Julius Goryavsky
parent d72c5d1ace
commit 75dd0246f8

View file

@ -1231,35 +1231,7 @@ bool wsrep_sync_wait (THD* thd, uint mask)
This allows autocommit SELECTs and a first SELECT after SET AUTOCOMMIT=0
TODO: modify to check if thd has locked any rows.
*/
if (thd->wsrep_cs().sync_wait(-1))
{
const char* msg;
int err;
/*
Possibly relevant error codes:
ER_CHECKREAD, ER_ERROR_ON_READ, ER_INVALID_DEFAULT, ER_EMPTY_QUERY,
ER_FUNCTION_NOT_DEFINED, ER_NOT_ALLOWED_COMMAND, ER_NOT_SUPPORTED_YET,
ER_FEATURE_DISABLED, ER_QUERY_INTERRUPTED
*/
switch (thd->wsrep_cs().current_error())
{
case wsrep::e_not_supported_error:
msg= "synchronous reads by wsrep backend. "
"Please unset wsrep_causal_reads variable.";
err= ER_NOT_SUPPORTED_YET;
break;
default:
msg= "Synchronous wait failed.";
err= ER_LOCK_WAIT_TIMEOUT; // NOTE: the above msg won't be displayed
// with ER_LOCK_WAIT_TIMEOUT
}
my_error(err, MYF(0), msg);
return true;
}
return thd->wsrep_cs().sync_wait(-1);
}
return false;