This commit is based on the work of Michal Schorm, rebased on the
earliest MariaDB version.
Th command line used to generate this diff was:
find ./ -type f \
-exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
-exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
-exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \
-exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \
-exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \
-exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
- Added sql/mariadb.h file that should be included first by files in sql
directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables
that must be done before my_global.h is included)
- Removed a lot of include my_global.h from include files
- Removed include's of some files that my_global.h automatically includes
- Removed duplicated include's of my_sys.h
- Replaced include my_config.h with my_global.h
include/atomic/generic-msvc.h:
prevent possible compiler warnings
include/lf.h:
comments, better definition for LF_HASH_OVERHEAD
include/maria.h:
define MARIA_CANNOT_ROLLBACK here
include/my_pthread.h:
avoid possible name clash
include/waiting_threads.h:
comments, const, move WT_RESOURCE to waiting_threads.c
mysql-test/suite/maria/r/maria_notembedded.result:
new test
mysql-test/suite/maria/t/maria_notembedded.test:
new test - 5-way deadlock
mysys/lf_hash.c:
better definition for LF_HASH_OVERHEAD
mysys/my_static.c:
comment
mysys/my_thr_init.c:
casts
mysys/waiting_threads.c:
comments, asserts, etc
server-tools/instance-manager/parse.cc:
fix my_init_dynamic_array() to follow new calling conventions
sql/mysqld.cc:
call wt_init after set_proper_floating_point_mode
sql/sql_class.h:
comment
storage/maria/ha_maria.cc:
move MARIA_CANNOT_ROLLBACK to a common header
storage/maria/ma_commit.c:
comment
storage/maria/ma_write.c:
comments, check for HA_ERR_FOUND_DUPP_KEY
storage/maria/trnman.c:
comments, assert
storage/maria/trnman.h:
comments
storage/maria/unittest/trnman-t.c:
be paranoid
unittest/mysys/lf-t.c:
comments
unittest/mysys/waiting_threads-t.c:
comments, safety, memory leak
include/waiting_threads.h:
don't #pragma pack
mysys/lf_hash.c:
typo in a comment
mysys/waiting_threads.c:
use the size of data, not the size of (possibly padded) structure
reader preference, at least where system rwlocks are fair.
include/my_global.h:
wt uses mutex-based rwlock implementation unless on linux
include/waiting_threads.h:
mutex-based rwlock implementation with reader preference
mysys/thr_rwlock.c:
revert the change. make my_rw_locks fair
mysys/waiting_threads.c:
mutex-based rwlock implementation with reader preference.
convert complex multi-line macros to static functions
include/my_global.h:
enable compile_time_assert for all compilers
include/waiting_threads.h:
1. don't #extern "C" system includes, they don't like it.
2. remove any padding from WT_RESOURCE_ID structure - we want
to compare it with memcmp
mysys/waiting_threads.c:
assert that WT_RESOURCE_ID can be compared with memcmp
and has no random padding bytes
it forces the user to bzero a key before setting it as a pointer, otherwise
it'll have random content on architectures where
sizeof(void*) < sizeof(ulonglong).
Declaring a key as ulonglong only (not a union) makes this user mistake
impossible.
include/waiting_threads.h:
WT_RESOURCE_ID::value is an ulonglong, not a union
mysys/waiting_threads.c:
WT_RESOURCE_ID::value is an ulonglong, not a union
storage/maria/ma_write.c:
WT_RESOURCE_ID::value is an ulonglong, not a union
storage/maria/trnman.c:
WT_RESOURCE_ID::value is an ulonglong, not a union
unittest/mysys/waiting_threads-t.c:
WT_RESOURCE_ID::value is an ulonglong, not a union
include/waiting_threads.h:
C_MODE_START/END
mysys/waiting_threads.c:
relax the checks - auto init thd in will_wait_for,
allow to destroy uninited thd (=noop),
allow a "release" an unexistent resource (=noop),
sql/sql_class.cc:
move wt* maintainance from maria to the server.
do THD::cleanup after ha_close_connection() and plugin_thdvar_cleanup().
storage/maria/unittest/trnman-t.c:
update to new prototype
include/my_pthread.h:
cleanup
include/waiting_threads.h:
header guard
mysys/waiting_threads.c:
bug - kill strategy were not applied to deadlocks of length 1.
cast timeout to ulonglong.
storage/maria/ma_static.c:
declare WT_RESOURCE_TYPE ma_rc_dup_unique
storage/maria/ma_write.c:
deadlock detection when waiting on unique key (useless until we can rollback)
storage/maria/maria_def.h:
deadlock detection when waiting on unique key (useless until we can rollback)
storage/maria/trnman.c:
use deadlock detector.
protect state transitions of a TRN with a mutex.
trnman_trid_to_trn() function.
storage/maria/trnman.h:
trnman_trid_to_trn() function
protect state transitions of a TRN with a mutex
use deadlock detector.
storage/maria/trnman_public.h:
trnman_trid_to_trn()
client/mysqltest.c:
compiler warnings
configure.in:
remove old tests for unused programs
disable the use of gcc built-ins if smp assembler atomics were selected explictily.
add waiting_threads.o to THREAD_LOBJECTS
include/lf.h:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
constructor/destructor in lf-alloc
include/my_pthread.h:
shuffle set_timespec/set_timespec_nsec macros a bit to be able to fill
several timeout structures with only one my_getsystime() call
include/waiting_threads.h:
waiting threads - wait-for graph and deadlock detection
mysys/Makefile.am:
add waiting_threads.c
mysys/lf_alloc-pin.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
constructor/destructor in lf-alloc
mysys/lf_hash.c:
constructor/destructor in lf-alloc
mysys/my_thr_init.c:
remember end-of-stack pointer in the mysys_var
mysys/waiting_threads.c:
waiting threads - wait-for graph and deadlock detection
storage/maria/ha_maria.cc:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/ma_commit.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/trnman.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/trnman_public.h:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/unittest/trnman-t.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
unittest/mysys/Makefile.am:
add waiting_threads-t
unittest/mysys/lf-t.c:
factor out the common code for multi-threaded stress unit tests
move lf tests to a separate file
unittest/mysys/my_atomic-t.c:
factor out the common code for multi-threaded stress unit tests
move lf tests to a separate file
unittest/mysys/thr_template.c:
factor out the common code for multi-threaded stress unit tests
unittest/mysys/waiting_threads-t.c:
wt tests