Skip to content

Commit

Permalink
Add new latest stable 10.4 // Update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
csandanov committed Jun 21, 2019
1 parent 1cda1ac commit b13ad1f
Show file tree
Hide file tree
Showing 9 changed files with 365 additions and 121 deletions.
36 changes: 21 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
version: 2.1
jobs:
mariadb-103:
mariadb-104:
# workaround https://discuss.circleci.com/t/post-clone-working-directory/15333/4
working_directory: ~/repo/10
machine: true
environment:
- ALPINE_VER: 3.9
- BASE_IMAGE_STABILITY_TAG: 2.2.3
- MARIADB_VER: 10.4.6
- TAGS: 10.4,10,latest
steps:
- checkout:
path: ~/repo
- run: make
- run: make test
- run: . ../release.sh

mariadb-103:
working_directory: ~/repo/10
machine: true
environment:
- ALPINE_VER: 3.9
- BASE_IMAGE_STABILITY_TAG: 2.2.3
- MARIADB_VER: 10.3.16
- TAGS: 10.3,10,latest
- TAGS: 10.3
steps:
- checkout:
path: ~/repo
- run: make
- run: make test
- run: . ../release.sh
# - notify-about-failure

mariadb-102:
working_directory: ~/repo/10
Expand All @@ -31,7 +45,6 @@ jobs:
- run: make
- run: make test
- run: . ../release.sh
# - notify-about-failure

mariadb-101:
working_directory: ~/repo/10
Expand All @@ -47,11 +60,14 @@ jobs:
- run: make
- run: make test
- run: . ../release.sh
# - notify-about-failure

workflows:
build-test-release:
jobs:
- mariadb-104:
filters:
tags:
only: /.*/
- mariadb-103:
filters:
tags:
Expand All @@ -64,13 +80,3 @@ workflows:
filters:
tags:
only: /.*/

commands:
notify-about-failure:
steps:
- run:
when: on_fail
name: 'Notify about failure by email'
command: |
aws ses send-email --region us-east-1 --from robot@wodby.com --to circleci@wodby.com \
--subject "MariaDB ${MARIADB_VER} build failed" --text "Build URL: ${CIRCLE_BUILD_URL}"
2 changes: 1 addition & 1 deletion 10/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-include env_make

MARIADB_VER ?= 10.3.16
MARIADB_VER ?= 10.4.6
MARIADB_VER_MINOR = $(shell echo "${MARIADB_VER}" | grep -oE '^[0-9]+\.[0-9]+')

ALPINE_VER ?= 3.9
Expand Down
67 changes: 67 additions & 0 deletions 10/patches/10.3/fix-c11-atomics-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
--- a/configure.cmake
+++ b/configure.cmake
@@ -135,10 +135,11 @@
IF(NOT LIBRT)
MY_SEARCH_LIBS(clock_gettime rt LIBRT)
ENDIF()
+ MY_SEARCH_LIBS(__atomic_load_8 atomic LIBATOMIC)
FIND_PACKAGE(Threads)

SET(CMAKE_REQUIRED_LIBRARIES
- ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO})
+ ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${LIBATOMIC} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO})
# Need explicit pthread for gcc -fsanitize=address
IF(CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES "-fsanitize=")
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} pthread)
@@ -919,14 +920,26 @@
return 0;
}"
HAVE_GCC_ATOMIC_BUILTINS)
-CHECK_CXX_SOURCE_COMPILES("
+
+SET(MAIN__ATOMIC_LOAD_N "
int main()
{
long long int var= 1;
long long int *ptr= &var;
return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
-}"
-HAVE_GCC_C11_ATOMICS)
+}")
+CHECK_CXX_SOURCE_COMPILES("${MAIN__ATOMIC_LOAD_N}" HAVE_GCC_C11_ATOMICS)
+IF(HAVE_GCC_C11_ATOMICS AND HAVE_LIBATOMIC)
+ SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+ LIST(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LIBATOMIC}")
+ CHECK_CXX_SOURCE_COMPILES("${MAIN__ATOMIC_LOAD_N}" HAVE_GCC_C11_INLINE_ATOMICS)
+ IF(HAVE_GCC_C11_INLINE_ATOMICS)
+ UNSET(HAVE_LIBATOMIC)
+ UNSET(LIBATOMIC)
+ ELSE()
+ SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES})
+ ENDIF()
+ENDIF()

IF(WITH_VALGRIND)
SET(HAVE_valgrind 1)
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -75,7 +75,7 @@

ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
- ${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_LIBRARY})
+ ${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBATOMIC} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_LIBRARY})
DTRACE_INSTRUMENT(mysys)

IF(HAVE_BFD_H)
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -142,7 +142,7 @@
if(WIN32)
set(SYSTEM_LIBS ${SYSTEM_LIBS} Shlwapi.lib Rpcrt4.lib)
else()
- set(SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})
+ set(SYSTEM_LIBS ${LIBATOMIC} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})
endif()

set(ROCKSDB_LIBS rocksdblib})
36 changes: 0 additions & 36 deletions 10/patches/10.3/fix-mysql-install-db-path.patch

This file was deleted.

15 changes: 15 additions & 0 deletions 10/patches/10.3/pcre.cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- a/cmake/pcre.cmake
+++ b/cmake/pcre.cmake
@@ -8,11 +8,7 @@
CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE_STACK_GUARD)
IF(NOT CMAKE_CROSSCOMPILING)
SET(CMAKE_REQUIRED_LIBRARIES "pcre")
- CHECK_C_SOURCE_RUNS("
- #include <pcre.h>
- int main() {
- return -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) < 256;
- }" PCRE_STACK_SIZE_OK)
+ SET(PCRE_STACK_SIZE_OK TRUE)
SET(CMAKE_REQUIRED_LIBRARIES)
ENDIF()
ENDIF()
67 changes: 67 additions & 0 deletions 10/patches/10.4/fix-c11-atomics-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
--- a/configure.cmake
+++ b/configure.cmake
@@ -135,10 +135,11 @@
IF(NOT LIBRT)
MY_SEARCH_LIBS(clock_gettime rt LIBRT)
ENDIF()
+ MY_SEARCH_LIBS(__atomic_load_8 atomic LIBATOMIC)
FIND_PACKAGE(Threads)

SET(CMAKE_REQUIRED_LIBRARIES
- ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO})
+ ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${LIBATOMIC} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO})
# Need explicit pthread for gcc -fsanitize=address
IF(CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES "-fsanitize=")
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} pthread)
@@ -919,14 +920,26 @@
return 0;
}"
HAVE_GCC_ATOMIC_BUILTINS)
-CHECK_CXX_SOURCE_COMPILES("
+
+SET(MAIN__ATOMIC_LOAD_N "
int main()
{
long long int var= 1;
long long int *ptr= &var;
return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
-}"
-HAVE_GCC_C11_ATOMICS)
+}")
+CHECK_CXX_SOURCE_COMPILES("${MAIN__ATOMIC_LOAD_N}" HAVE_GCC_C11_ATOMICS)
+IF(HAVE_GCC_C11_ATOMICS AND HAVE_LIBATOMIC)
+ SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+ LIST(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LIBATOMIC}")
+ CHECK_CXX_SOURCE_COMPILES("${MAIN__ATOMIC_LOAD_N}" HAVE_GCC_C11_INLINE_ATOMICS)
+ IF(HAVE_GCC_C11_INLINE_ATOMICS)
+ UNSET(HAVE_LIBATOMIC)
+ UNSET(LIBATOMIC)
+ ELSE()
+ SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES})
+ ENDIF()
+ENDIF()

IF(WITH_VALGRIND)
SET(HAVE_valgrind 1)
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -75,7 +75,7 @@

ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
- ${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_LIBRARY})
+ ${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBATOMIC} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_LIBRARY})
DTRACE_INSTRUMENT(mysys)

IF(HAVE_BFD_H)
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -142,7 +142,7 @@
if(WIN32)
set(SYSTEM_LIBS ${SYSTEM_LIBS} Shlwapi.lib Rpcrt4.lib)
else()
- set(SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})
+ set(SYSTEM_LIBS ${LIBATOMIC} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})
endif()

set(ROCKSDB_LIBS rocksdblib})
15 changes: 15 additions & 0 deletions 10/patches/10.4/pcre.cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- a/cmake/pcre.cmake
+++ b/cmake/pcre.cmake
@@ -8,11 +8,7 @@
CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE_STACK_GUARD)
IF(NOT CMAKE_CROSSCOMPILING)
SET(CMAKE_REQUIRED_LIBRARIES "pcre")
- CHECK_C_SOURCE_RUNS("
- #include <pcre.h>
- int main() {
- return -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) < 256;
- }" PCRE_STACK_SIZE_OK)
+ SET(PCRE_STACK_SIZE_OK TRUE)
SET(CMAKE_REQUIRED_LIBRARIES)
ENDIF()
ENDIF()
98 changes: 98 additions & 0 deletions 10/templates/10.4/my.cnf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[mysqld_safe]

[mysqldump]
quick
quote-names
max_allowed_packet = {{ getenv "MYSQL_DUMP_MAX_ALLOWED_PACKET" "1G" }}

[mysqlhotcopy]
interactive-timeout

[client]
port = {{ getenv "MYSQL_PORT" "3306" }}
socket = /var/run/mysqld/mysqld.sock
default-character-set = {{ getenv "MYSQL_CLIENT_DEFAULT_CHARACTER_SET" "utf8" }}

{{ if getenv "MARIADB_PLUGIN_LOAD" }}
[mariadb]
plugin_load = {{ getenv "MARIADB_PLUGIN_LOAD" }}
{{ end }}

[mysqld]
user = mysql
bind-address = 0.0.0.0
basedir = /usr
datadir = /var/lib/mysql
connect_timeout = {{ getenv "MYSQL_CONNECT_TIMEOUT" "10" }}
socket = /var/run/mysqld/mysqld.sock
log-warnings

collation-server = {{ getenv "MYSQL_COLLATION_SERVER" "utf8_unicode_ci" }}
init_connect = '{{ getenv "MYSQL_INIT_CONNECT" "SET NAMES utf8" }}'
character_set_server = {{ getenv "MYSQL_CHARACTER_SET_SERVER" "utf8" }}
character_set_filesystem = {{ getenv "MYSQL_CHARACTER_SET_FILESYSTEM" "utf8" }}

symbolic-links = 0
default_storage_engine = {{ getenv "MYSQL_DEFAULT_STORAGE_ENGINE" "InnoDB" }}

skip-character-set-client-handshake
skip-name-resolve

back_log = {{ getenv "MYSQL_BACK_LOG" "100" }}

join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" "8M" }}
max_heap_table_size = {{ getenv "MYSQL_MAX_HEAP_TABLE_SIZE" "16M" }}
query_cache_limit = {{ getenv "MYSQL_QUERY_CACHE_LIMIT" "1M" }}
query_cache_min_res_unit = {{ getenv "MYSQL_QUERY_CACHE_MIN_RES_UNIT" "4K" }}
query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "128M" }}
query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "ON" }}
sort_buffer_size = {{ getenv "MYSQL_SORT_BUFFER_SIZE" "2M" }}
table_definition_cache = {{ getenv "MYSQL_TABLE_DEFINITION_CACHE" "400" }}
table_open_cache = {{ getenv "MYSQL_TABLE_OPEN_CACHE" "4096" }}
thread_cache_size = {{ getenv "MYSQL_THREAD_CACHE_SIZE" "75" }}
tmp_table_size = {{ getenv "MYSQL_TMP_TABLE_SIZE" "16M" }}

max_allowed_packet = {{ getenv "MYSQL_MAX_ALLOWED_PACKET" "256M" }}
max_connect_errors = {{ getenv "MYSQL_MAX_CONNECT_ERRORS" "100000" }}
max_connections = {{ getenv "MYSQL_MAX_CONNECTIONS" "100" }}

innodb_buffer_pool_instances = {{ getenv "MYSQL_INNODB_BUFFER_POOL_INSTANCES" "1" }}
innodb_buffer_pool_size = {{ getenv "MYSQL_INNODB_BUFFER_POOL_SIZE" "128M" }}
innodb_data_file_path = {{ getenv "MYSQL_INNODB_DATA_FILE_PATH" "ibdata1:10M:autoextend:max:10G" }}
innodb_default_row_format = {{ getenv "MYSQL_INNODB_DEFAULT_ROW_FORMAT" "dynamic" }}
innodb_fast_shutdown = {{ getenv "MYSQL_INNODB_FAST_SHUTDOWN" "1" }}
innodb_file_per_table = {{ getenv "MYSQL_INNODB_FILE_PER_TABLE" "1" }}
innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "2" }}
innodb_flush_method = {{ getenv "MYSQL_INNODB_FLUSH_METHOD" "O_DIRECT" }}
innodb_force_load_corrupted = {{ getenv "MYSQL_INNODB_FORCE_LOAD_CORRUPTED" "0" }}
innodb_force_recovery = {{ getenv "MYSQL_INNODB_FORCE_RECOVERY" "0" }}
innodb_io_capacity = {{ getenv "MYSQL_INNODB_IO_CAPACITY" "200" }}
innodb_lock_wait_timeout = {{ getenv "MYSQL_INNODB_LOCK_WAIT_TIMEOUT" "50" }}
innodb_log_buffer_size = {{ getenv "MYSQL_INNODB_LOG_BUFFER_SIZE" "8M" }}
innodb_log_file_size = {{ getenv "MYSQL_INNODB_LOG_FILE_SIZE" "128M" }}
innodb_log_files_in_group = {{ getenv "MYSQL_INNODB_LOG_FILES_IN_GROUP" "2" }}
innodb_old_blocks_time = {{ getenv "MYSQL_INNODB_OLD_BLOCKS_TIME" "1000" }}
innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" "1024" }}
innodb_purge_threads = {{ getenv "MYSQL_INNODB_PURGE_THREADS" "4" }}
innodb_read_io_threads = {{ getenv "MYSQL_INNODB_READ_IO_THREADS" "4" }}
innodb_stats_on_metadata = {{ getenv "MYSQL_INNODB_STATS_ON_METADATA" "OFF" }}
innodb_strict_mode = {{ getenv "MYSQL_INNODB_STRICT_MODE" "OFF" }}
innodb_write_io_threads = {{ getenv "MYSQL_INNODB_WRITE_IO_THREADS" "4" }}

performance_schema = {{ getenv "MYSQL_PERFORMANCE_SCHEMA" "OFF" }}

long_query_time = {{ getenv "MYSQL_LONG_QUERY_TIME" "2" }}
slow_query_log = {{ getenv "MYSQL_SLOW_QUERY_LOG" "OFF" }}
general_log = {{ getenv "MYSQL_GENERAL_LOG" "0" }}

log_warnings = {{ getenv "MYSQL_LOG_WARNINGS" "2" }}

net_write_timeout = {{ getenv "MYSQL_NET_WRITE_TIMEOUT" "90" }}
net_read_timeout = {{ getenv "MYSQL_NET_READ_TIMEOUT" "90" }}
wait_timeout = {{ getenv "MYSQL_WAIT_TIMEOUT" "420" }}
interactive_timeout = {{ getenv "MYSQL_INTERACTIVE_TIMEOUT" "420" }}

relay_log_recovery = {{ getenv "MYSQL_RELAY_LOG_RECOVERY" "0" }}

optimizer_prune_level = {{ getenv "MYSQL_OPTIMIZER_PRUNE_LEVEL" "1" }}
optimizer_search_depth = {{ getenv "MYSQL_OPTIMIZER_SEARCH_DEPTH" "62" }}
Loading

0 comments on commit b13ad1f

Please sign in to comment.