diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cf502b42..4f8cf8105 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,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}/include/maxscale/version.h.in ${CMAKE_BINARY_DIR}/include/maxscale/version.h @ONLY) configure_file(${CMAKE_SOURCE_DIR}/include/maxscale/paths.h.in ${CMAKE_BINARY_DIR}/include/maxscale/paths.h @ONLY) diff --git a/include/maxscale/version.h.in b/include/maxscale/version.h.in index c15fa862d..3e17ebe04 100644 --- a/include/maxscale/version.h.in +++ b/include/maxscale/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@" diff --git a/server/core/gateway.cc b/server/core/gateway.cc index cc7d68e2a..7366b2e62 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -1375,6 +1375,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/modules/routing/avrorouter/avro_file.c b/server/modules/routing/avrorouter/avro_file.c index 833be696f..5f9745435 100644 --- a/server/modules/routing/avrorouter/avro_file.c +++ b/server/modules/routing/avrorouter/avro_file.c @@ -123,7 +123,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 { diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.c b/server/modules/routing/readwritesplit/rwsplit_route_stmt.c index 183709d4f..27fe33470 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.c +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.c @@ -594,7 +594,8 @@ bool rwsplit_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.master_accept_reads && SERVER_IS_MASTER(&server))) { if (max_rlag == MAX_RLAG_UNDEFINED || (b->server->rlag != MAX_RLAG_NOT_AVAILABLE &&