From fd2df3a863fcbacfee348f7c782e2a46f756d70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 8 Mar 2017 20:03:45 +0200 Subject: [PATCH 1/3] Always open files with configured block size If the Avro file already exists, it should be opened with the configured block size instead of the default block size of 16 kilobytes. --- server/modules/routing/avro/avro_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/modules/routing/avro/avro_file.c b/server/modules/routing/avro/avro_file.c index 41ef968f3..4d9819f0d 100644 --- a/server/modules/routing/avro/avro_file.c +++ b/server/modules/routing/avro/avro_file.c @@ -122,7 +122,7 @@ AVRO_TABLE* avro_table_alloc(const char* filepath, const char* json_schema, size if (access(filepath, F_OK) == 0) { - rc = avro_file_writer_open(filepath, &table->avro_file); + rc = avro_file_writer_open_bs(filepath, &table->avro_file, block_size); } else { From d764bb9e1f35266803cba95561b118b829fdfba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 9 Mar 2017 07:45:29 +0200 Subject: [PATCH 2/3] MXS-1178: Fix master_accept_reads The order of the servers in the service definition could break the master_accept_reads functionality. When the first server defined in the service is a slave, it will always be picked as the first candidate for reads. The master would only be considered as a candidate for reads if no previous candidate was available. For this reason, the master_accept_reads only worked when the first server in the list was the master. --- server/modules/routing/readwritesplit/readwritesplit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index dc67558a0..339ba6b39 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -1236,7 +1236,8 @@ static bool get_dcb(DCB **p_dcb, ROUTER_CLIENT_SES *rses, backend_type_t btype, * backend and update assign it to new candidate if * necessary. */ - else if (SERVER_IS_SLAVE(&server)) + else if (SERVER_IS_SLAVE(&server) || + (rses->rses_config.rw_master_reads && SERVER_IS_MASTER(&server))) { if (max_rlag == MAX_RLAG_UNDEFINED || (b->backend_server->rlag != MAX_RLAG_NOT_AVAILABLE && From 84a6848f10af80d847a9e75bd53970d5709d05c4 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Mon, 20 Feb 2017 13:41:51 +0200 Subject: [PATCH 3/3] Add build information to --version-full If the Jenkins build information is available, print it in the full version output. --- CMakeLists.txt | 7 +++++++ server/core/gateway.c | 12 ++++++++++++ server/include/version.h.in | 3 +++ 3 files changed, 22 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f29db5dd3..fe46a7232 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,6 +162,13 @@ if(${MAXSCALE_VERSION} MATCHES "-stable") endif() endif() +# Copy cmake_flags, JENKINS_BUILD_TAG, source and value evironmental variables +# into cmake variables. These are used by the build system to store information +# about the packages being built. +set(MAXSCALE_SOURCE "$ENV{source} $ENV{value}") +set(MAXSCALE_CMAKE_FLAGS "$ENV{cmake_flags}") +set(MAXSCALE_JENKINS_BUILD_TAG "$ENV{BUILD_TAG}") + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/server/include) configure_file(${CMAKE_SOURCE_DIR}/server/include/version.h.in ${CMAKE_BINARY_DIR}/server/include/version.h @ONLY) configure_file(${CMAKE_SOURCE_DIR}/server/include/gwdirs.h.in ${CMAKE_BINARY_DIR}/server/include/gwdirs.h @ONLY) diff --git a/server/core/gateway.c b/server/core/gateway.c index a87fba03b..0177d2321 100644 --- a/server/core/gateway.c +++ b/server/core/gateway.c @@ -1341,6 +1341,18 @@ int main(int argc, char **argv) case 'V': rc = EXIT_SUCCESS; printf("MaxScale %s - %s\n", MAXSCALE_VERSION, maxscale_commit); + if (strcmp(MAXSCALE_SOURCE, " ") != 0) + { + printf("Source: %s\n", MAXSCALE_SOURCE); + } + if (strcmp(MAXSCALE_CMAKE_FLAGS, "") != 0) + { + printf("CMake flags: %s\n", MAXSCALE_CMAKE_FLAGS); + } + if (strcmp(MAXSCALE_JENKINS_BUILD_TAG, "") != 0) + { + printf("Jenkins build: %s\n", MAXSCALE_JENKINS_BUILD_TAG); + } goto return_main; case 'l': diff --git a/server/include/version.h.in b/server/include/version.h.in index c15fa862d..3e17ebe04 100644 --- a/server/include/version.h.in +++ b/server/include/version.h.in @@ -1,2 +1,5 @@ #define MAXSCALE_VERSION "@MAXSCALE_VERSION@" #define MAXSCALE_COMMIT "@MAXSCALE_COMMIT@" +#define MAXSCALE_SOURCE "@MAXSCALE_SOURCE@" +#define MAXSCALE_CMAKE_FLAGS "@MAXSCALE_CMAKE_FLAGS@" +#define MAXSCALE_JENKINS_BUILD_TAG "@MAXSCALE_JENKINS_BUILD_TAG@"