85774e7...
by
Alexey Yurchenko <email address hidden>
MDEV-17048 Inconsistency voting support
* Collect and pass apply error data to provider
* Rollback failed transaction and continue operation if provider returns
SUCCESS
* MTR tests for inconsistency voting
Decrease stack space usage of mysql_execute_command()
The extensive usage of stack space, especially when used with ASan
(AdressSanitizer) of mysql_execute_command caused the test
rpl.rpl_row_sp011 to fail because it did run out of stack. In this
test case mysql_execute_command is called recursively for each
function all.
Changes done:
- Changed a few functions that used big local variables to be marked
__attribute__ ((noinline))
- Moved sub parts that used big local variables to external functions.
- Changed wsrep_commit_empty() from inline to normal function as this used
more than 1K of stack space and because there is no reason for this
rarely used function to be inline.
End result (with gcc 7.4.1 on Intel Xeon):
Starting point for stack space usage:
gcc -O: 7800
gcc with -fsanitize=address -O (ASan) : 27240
After this patch:
gcc -O: 1160
gcc -O0 (debug build) 1584
gcc with -fsanitize=address -O (ASan): 4424
gcc with -fsanitize=address -O2 (ASan): 3874
A 6x improvement and will allow us to run all mtr tests with ASan.
Decrease stack space usage of mysql_execute_command()
- WSREP_DEBUG called WSREP_LOG which allocated a 1K variable on stack
for each macro usage (at least gcc can't reuse the stack space).
Move this concatenation to happen compile-time, not run-time.