diff --git a/Documentation/Changelog.md b/Documentation/Changelog.md index 8812b28cd..f9cb04d23 100644 --- a/Documentation/Changelog.md +++ b/Documentation/Changelog.md @@ -43,6 +43,7 @@ For more details, please refer to: For more details, please refer to: +* [MariaDB MaxScale 2.3.6 Release Notes](Release-Notes/MaxScale-2.3.6-Release-Notes.md) * [MariaDB MaxScale 2.3.5 Release Notes](Release-Notes/MaxScale-2.3.5-Release-Notes.md) * [MariaDB MaxScale 2.3.4 Release Notes](Release-Notes/MaxScale-2.3.4-Release-Notes.md) * [MariaDB MaxScale 2.3.3 Release Notes](Release-Notes/MaxScale-2.3.3-Release-Notes.md) diff --git a/Documentation/Getting-Started/Configuration-Guide.md b/Documentation/Getting-Started/Configuration-Guide.md index facc1969f..50b7bd31c 100644 --- a/Documentation/Getting-Started/Configuration-Guide.md +++ b/Documentation/Getting-Started/Configuration-Guide.md @@ -709,7 +709,9 @@ _qc_sqlite_. #### `query_classifier_cache_size` Specifies the maximum size of the query classifier cache. The default limit is -40% of total system memory. +15% of total system memory starting with MaxScale 2.3.7. In older versions the +default limit was 40% of total system memory. This feature was added in MaxScale +2.3.0. When the query classifier cache has been enabled, MaxScale will, after a statement has been parsed, store the classification result using the @@ -885,7 +887,7 @@ than `0`, this configuration setting will not have an effect. #### `writeq_high_water` High water mark for network write buffer. Controls when network traffic -throtting is started. The parameter accepts size type values. +throtting is started. The parameter accepts [size type values](#sizes). More specifically, if the client side write queue is above this value, it will block traffic coming from backend servers. If the backend side write queue is @@ -899,7 +901,7 @@ throtting is enabled. By default, traffic throttling is disabled. Low water mark for network write buffer. Once the traffic throttling is enabled, it will only be disabled when the write queue is below `writeq_low_water`. The -parameter accepts size type values. The minimum allowed size is 512 +parameter accepts [size type values](#sizes). The minimum allowed size is 512 bytes. `writeq_high_water` must always be greater than `writeq_low_water`. #### `load_persisted_configs` diff --git a/Documentation/Release-Notes/MaxScale-2.3.6-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.3.6-Release-Notes.md index 0ac6a919e..29ae50b32 100644 --- a/Documentation/Release-Notes/MaxScale-2.3.6-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.3.6-Release-Notes.md @@ -1,4 +1,4 @@ -# MariaDB MaxScale 2.3.6 Release Notes +# MariaDB MaxScale 2.3.6 Release Notes -- 2019-04-23 Release 2.3.6 is a GA release. @@ -11,6 +11,7 @@ report on [our Jira](https://jira.mariadb.org/projects/MXS). ## New Features * [MXS-2417](https://jira.mariadb.org/browse/MXS-2417) MaxScale main config should take precedence over runtime config on restart +* [MXS-2344](https://jira.mariadb.org/browse/MXS-2344) Support MASTER_SSL in mariadbmon for encrypting replication traffic ### REST API & MaxCtrl: Hard maintenance mode @@ -24,8 +25,12 @@ the `set` endpoint. ## Bug fixes +* [MXS-2423](https://jira.mariadb.org/browse/MXS-2423) retain_last_statements not in maxctrl show maxscale * [MXS-2419](https://jira.mariadb.org/browse/MXS-2419) Hangs on query during multiple transaction replays * [MXS-2418](https://jira.mariadb.org/browse/MXS-2418) Crash on transaction replay if log_info is on and session starts with no master +* [MXS-2416](https://jira.mariadb.org/browse/MXS-2416) Possible memory leak +* [MXS-2324](https://jira.mariadb.org/browse/MXS-2324) Maxscale disconnect after commit without begin from Icinga2 +* [MXS-2259](https://jira.mariadb.org/browse/MXS-2259) Maxscale consumes large amounts of memory even with buffer limits set. ## Known Issues and Limitations diff --git a/VERSION23.cmake b/VERSION23.cmake index 643875ab7..3bceeb242 100644 --- a/VERSION23.cmake +++ b/VERSION23.cmake @@ -5,7 +5,7 @@ set(MAXSCALE_VERSION_MAJOR "2" CACHE STRING "Major version") set(MAXSCALE_VERSION_MINOR "3" CACHE STRING "Minor version") -set(MAXSCALE_VERSION_PATCH "6" CACHE STRING "Patch version") +set(MAXSCALE_VERSION_PATCH "7" CACHE STRING "Patch version") # This should only be incremented if a package is rebuilt set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number") diff --git a/include/maxscale/protocol/rwbackend.hh b/include/maxscale/protocol/rwbackend.hh index 6bf3ae6ea..515f42a54 100644 --- a/include/maxscale/protocol/rwbackend.hh +++ b/include/maxscale/protocol/rwbackend.hh @@ -167,6 +167,7 @@ private: ResponseStat m_response_stat; uint64_t m_num_coldefs = 0; bool m_large_query = false; + bool m_skip_next = false; inline bool is_opening_cursor() const { diff --git a/maxctrl/lib/alter.js b/maxctrl/lib/alter.js index 2c6294e26..88bd3eee8 100644 --- a/maxctrl/lib/alter.js +++ b/maxctrl/lib/alter.js @@ -135,6 +135,28 @@ exports.builder = function(yargs) { return updateValue(host, 'maxscale', 'data.attributes.parameters.' + argv.key, argv.value) }) }) + .command('user ', 'Alter admin user passwords', function(yargs) { + return yargs.epilog('Changes the password for a user. To change the user type, destroy the user and then create it again.') + .usage('Usage: alter user ') + }, function(argv) { + maxctrl(argv, function(host) { + + var user = { + 'data': { + 'id': argv.name, + 'type': 'inet', + 'attributes': { + 'password': argv.password + } + } + } + + return getJson(host, 'users/inet/' + argv.name) + .then((res) => user.data.attributes.account = res.data.attributes.account) + .then(() => doRequest(host, 'users/inet/' + argv.name, null, {method: 'DELETE'})) + .then(() => doRequest(host, 'users/inet', null, {method: 'POST', body: user})) + }) + }) .usage('Usage: alter ') .help() .command('*', 'the default command', {}, function(argv) { diff --git a/maxctrl/lib/create.js b/maxctrl/lib/create.js index 3719b3f5c..8007a78c2 100644 --- a/maxctrl/lib/create.js +++ b/maxctrl/lib/create.js @@ -166,12 +166,10 @@ exports.builder = function(yargs) { } } - if (argv.params) { - var err = validateParams(argv, argv.params) - if (err) { - return Promise.reject(err) - } + var err = false; + if (argv.params) { + err = validateParams(argv, argv.params) monitor.data.attributes.parameters = argv.params.reduce(to_obj, {}) } @@ -189,6 +187,9 @@ exports.builder = function(yargs) { } maxctrl(argv, function(host) { + if (err) { + return Promise.reject(err) + } return doRequest(host, 'monitors', null, {method: 'POST', body: monitor}) }) }) diff --git a/maxctrl/test/alter.js b/maxctrl/test/alter.js index a0d45b3f5..14fcf62df 100644 --- a/maxctrl/test/alter.js +++ b/maxctrl/test/alter.js @@ -108,5 +108,17 @@ describe("Alter Commands", function() { .should.be.rejected }) + it('creates user', function() { + return verifyCommand('create user testuser test', 'users/inet/testuser') + }) + + it('alters the password of a user', function() { + return verifyCommand('alter user testuser test2', 'users/inet/testuser') + }) + + it('destroys the altered user', function() { + return doCommand('destroy user testuser') + }) + after(stopMaxScale) }); diff --git a/maxctrl/test/createdestroy.js b/maxctrl/test/createdestroy.js index c623f3628..8fcafc622 100644 --- a/maxctrl/test/createdestroy.js +++ b/maxctrl/test/createdestroy.js @@ -18,6 +18,18 @@ describe("Create/Destroy Commands", function() { .should.be.rejected }) + it('monitor without parameters fails due to missing user parameter', function() { + return verifyCommand('create monitor my-monitor mysqlmon', 'monitors/my-monitor') + .should.be.rejected + }) + + it('destroy monitor created without parameters', function() { + return doCommand('destroy monitor my-monitor') + .should.be.fulfilled + .then(() => doCommand('show monitor my-monitor')) + .should.be.rejected + }) + it('will not destroy the same monitor again', function() { return doCommand('destroy monitor my-monitor') .should.be.rejected @@ -38,6 +50,11 @@ describe("Create/Destroy Commands", function() { .should.be.rejected }) + it('will not create monitor with malformed parameters', function() { + return doCommand('create monitor my-monitor mariadbmon not-a-param') + .should.be.rejected + }) + it('create monitor with options', function() { return doCommand('unlink monitor MariaDB-Monitor server4') .then(() => verifyCommand('create monitor my-monitor mysqlmon --servers server4 --monitor-user maxuser --monitor-password maxpwd', diff --git a/maxctrl/test/drain.js b/maxctrl/test/drain.js index b4d5f6673..ec489b8d1 100644 --- a/maxctrl/test/drain.js +++ b/maxctrl/test/drain.js @@ -15,5 +15,10 @@ describe("Draining servers", function() { .should.eventually.have.string("Maintenance") }) + it('does not drain non-existent server', function() { + return doCommand('drain server not-a-server') + .should.be.rejected + }) + after(stopMaxScale) }); diff --git a/maxctrl/test/unknown.js b/maxctrl/test/unknown.js index 7f818095a..1d0a30470 100644 --- a/maxctrl/test/unknown.js +++ b/maxctrl/test/unknown.js @@ -19,7 +19,8 @@ describe("Unknown Commands", function() { 'alter', 'rotate', 'call', - 'cluster' + 'cluster', + 'drain' ] endpoints.forEach(function (i) { diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mysqlmon_multimaster_serverid b/maxscale-system-test/cnf/maxscale.cnf.template.mysqlmon_multimaster_serverid index fd7a0d8ea..5951c550a 100644 --- a/maxscale-system-test/cnf/maxscale.cnf.template.mysqlmon_multimaster_serverid +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mysqlmon_multimaster_serverid @@ -10,6 +10,7 @@ user=maxskysql password= skysql detect_stale_master=0 monitor_interval=1000 +assume_unique_hostnames=false [RW-Split-Router] type=service @@ -18,6 +19,7 @@ servers=server1, server2, server3, server4 user=maxskysql password=skysql slave_selection_criteria=LEAST_ROUTER_CONNECTIONS +max_slave_replication_lag=1 [Read-Connection-Router-Slave] type=service diff --git a/maxscale-system-test/mdbci/cnf/galera_server1.cnf b/maxscale-system-test/mdbci/cnf/galera_server1.cnf index a378434b0..ef833fd05 100644 --- a/maxscale-system-test/mdbci/cnf/galera_server1.cnf +++ b/maxscale-system-test/mdbci/cnf/galera_server1.cnf @@ -7,7 +7,7 @@ wsrep_on=ON # Row binary log format is required by Galera binlog_format=ROW -log-bin +log-bin=mar-bin # InnoDB is currently the only storage engine supported by Galera default-storage-engine=innodb @@ -16,9 +16,6 @@ innodb_file_per_table # To avoid issues with 'bulk mode inserts' using autoincrement fields innodb_autoinc_lock_mode=2 -# Required to prevent deadlocks on parallel transaction execution -innodb_locks_unsafe_for_binlog=1 - # Query Cache is not supported by Galera wsrep replication query_cache_size=0 query_cache_type=0 @@ -87,9 +84,6 @@ wsrep_auto_increment_control=1 # Retry autoinc insert, when the insert failed for "duplicate key error" wsrep_drupal_282555_workaround=0 -# Enable "strictly synchronous" semantics for read operations -wsrep_causal_reads=1 - # Command to call when node status or cluster membership changes. # Will be passed all or some of the following options: # --status - new status of this node diff --git a/maxscale-system-test/mdbci/cnf/galera_server2.cnf b/maxscale-system-test/mdbci/cnf/galera_server2.cnf index acfc2a358..0df6aa09c 100644 --- a/maxscale-system-test/mdbci/cnf/galera_server2.cnf +++ b/maxscale-system-test/mdbci/cnf/galera_server2.cnf @@ -7,7 +7,7 @@ wsrep_on=ON # Row binary log format is required by Galera binlog_format=ROW -log-bin +log-bin=mar-bin # InnoDB is currently the only storage engine supported by Galera default-storage-engine=innodb @@ -16,9 +16,6 @@ innodb_file_per_table # To avoid issues with 'bulk mode inserts' using autoincrement fields innodb_autoinc_lock_mode=2 -# Required to prevent deadlocks on parallel transaction execution -innodb_locks_unsafe_for_binlog=1 - # Query Cache is not supported by Galera wsrep replication query_cache_size=0 query_cache_type=0 @@ -87,9 +84,6 @@ wsrep_auto_increment_control=1 # Retry autoinc insert, when the insert failed for "duplicate key error" wsrep_drupal_282555_workaround=0 -# Enable "strictly synchronous" semantics for read operations -wsrep_causal_reads=1 - # Command to call when node status or cluster membership changes. # Will be passed all or some of the following options: # --status - new status of this node diff --git a/maxscale-system-test/mdbci/cnf/galera_server3.cnf b/maxscale-system-test/mdbci/cnf/galera_server3.cnf index a393b7613..efc663255 100644 --- a/maxscale-system-test/mdbci/cnf/galera_server3.cnf +++ b/maxscale-system-test/mdbci/cnf/galera_server3.cnf @@ -7,7 +7,7 @@ wsrep_on=ON # Row binary log format is required by Galera binlog_format=ROW -log-bin +log-bin=mar-bin # InnoDB is currently the only storage engine supported by Galera default-storage-engine=innodb @@ -16,9 +16,6 @@ innodb_file_per_table # To avoid issues with 'bulk mode inserts' using autoincrement fields innodb_autoinc_lock_mode=2 -# Required to prevent deadlocks on parallel transaction execution -innodb_locks_unsafe_for_binlog=1 - # Query Cache is not supported by Galera wsrep replication query_cache_size=0 query_cache_type=0 @@ -87,9 +84,6 @@ wsrep_auto_increment_control=1 # Retry autoinc insert, when the insert failed for "duplicate key error" wsrep_drupal_282555_workaround=0 -# Enable "strictly synchronous" semantics for read operations -wsrep_causal_reads=1 - # Command to call when node status or cluster membership changes. # Will be passed all or some of the following options: # --status - new status of this node diff --git a/maxscale-system-test/mdbci/cnf/galera_server4.cnf b/maxscale-system-test/mdbci/cnf/galera_server4.cnf index 2854acf02..4a13b1776 100644 --- a/maxscale-system-test/mdbci/cnf/galera_server4.cnf +++ b/maxscale-system-test/mdbci/cnf/galera_server4.cnf @@ -7,7 +7,7 @@ wsrep_on=ON # Row binary log format is required by Galera binlog_format=ROW -log-bin +log-bin=mar-bin # InnoDB is currently the only storage engine supported by Galera default-storage-engine=innodb @@ -16,9 +16,6 @@ innodb_file_per_table # To avoid issues with 'bulk mode inserts' using autoincrement fields innodb_autoinc_lock_mode=2 -# Required to prevent deadlocks on parallel transaction execution -innodb_locks_unsafe_for_binlog=1 - # Query Cache is not supported by Galera wsrep replication query_cache_size=0 query_cache_type=0 @@ -87,9 +84,6 @@ wsrep_auto_increment_control=1 # Retry autoinc insert, when the insert failed for "duplicate key error" wsrep_drupal_282555_workaround=0 -# Enable "strictly synchronous" semantics for read operations -wsrep_causal_reads=1 - # Command to call when node status or cluster membership changes. # Will be passed all or some of the following options: # --status - new status of this node diff --git a/maxscale-system-test/mxs559_block_master.cpp b/maxscale-system-test/mxs559_block_master.cpp index 9e9d64ebc..919708086 100644 --- a/maxscale-system-test/mxs559_block_master.cpp +++ b/maxscale-system-test/mxs559_block_master.cpp @@ -114,6 +114,7 @@ int main(int argc, char* argv[]) test.try_query(test.maxscales->conn_rwsplit[0], "DROP TABLE IF EXISTS t1"); test.maxscales->close_maxscale_connections(0); + test.maxscales->wait_for_monitor(); test.check_maxscale_alive(0); test.log_excludes(0, "due to authentication failure"); test.log_excludes(0, "due to handshake failure"); diff --git a/maxscale-system-test/non_native_setup.cpp b/maxscale-system-test/non_native_setup.cpp index 8913d151f..a48c2e682 100644 --- a/maxscale-system-test/non_native_setup.cpp +++ b/maxscale-system-test/non_native_setup.cpp @@ -26,10 +26,7 @@ int main(int argc, char* argv[]) std::string(" ") + std::string(argv[1]); - int local_argc = argc - 1; - char** local_argv = &argv[1]; - - TestConnections test(local_argc, local_argv); + TestConnections test(argc, argv); sleep(3); setenv("src_dir", test_dir, 1); diff --git a/server/core/config.cc b/server/core/config.cc index 8082c2f82..69a9ba995 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -2984,7 +2984,7 @@ void config_set_global_defaults() gateway.peer_password[0] = '\0'; gateway.log_target = MXB_LOG_TARGET_DEFAULT; - gateway.qc_cache_properties.max_size = get_total_memory() * 0.4; + gateway.qc_cache_properties.max_size = get_total_memory() * 0.15; if (gateway.qc_cache_properties.max_size == 0) { diff --git a/server/core/dcb.cc b/server/core/dcb.cc index 8583c0c44..2fdec9032 100644 --- a/server/core/dcb.cc +++ b/server/core/dcb.cc @@ -513,6 +513,7 @@ int dcb_read(DCB* dcb, GWBUF** head, int maxbytes) { + mxb_assert(dcb->owner == RoutingWorker::get_current()); int nsingleread = 0; int nreadtotal = 0; @@ -853,6 +854,7 @@ static int dcb_log_errors_SSL(DCB* dcb, int ret) */ int dcb_write(DCB* dcb, GWBUF* queue) { + mxb_assert(dcb->owner == RoutingWorker::get_current()); dcb->writeqlen += gwbuf_length(queue); // The following guarantees that queue is not NULL if (!dcb_write_parameter_check(dcb, queue)) @@ -2825,6 +2827,7 @@ public: RoutingWorker& rworker = static_cast(worker); if (dcb_is_still_valid(m_dcb, rworker.id()) && m_dcb->m_uid == m_uid) { + mxb_assert(m_dcb->owner == RoutingWorker::get_current()); m_dcb->fakeq = m_buffer; dcb_handler(m_dcb, m_ev); } @@ -2845,6 +2848,7 @@ static void poll_add_event_to_dcb(DCB* dcb, GWBUF* buf, uint32_t ev) { if (dcb == this_thread.current_dcb) { + mxb_assert(dcb->owner == RoutingWorker::get_current()); // If the fake event is added to the current DCB, we arrange for // it to be handled immediately in dcb_handler() when the handling // of the current events are done... diff --git a/server/core/query_classifier.cc b/server/core/query_classifier.cc index 3fd1aae13..aa0d83ad8 100644 --- a/server/core/query_classifier.cc +++ b/server/core/query_classifier.cc @@ -177,10 +177,15 @@ public: mxb_assert(peek(canonical_stmt) == nullptr); mxb_assert(this_unit.classifier); + // 0xffffff is the maximum packet size, 4 is for packet header and 1 is for command byte. These are + // MariaDB/MySQL protocol specific values that are also defined in but + // should not be exposed to the core. + constexpr int64_t max_entry_size = 0xffffff - 5; + int64_t cache_max_size = this_unit.cache_max_size() / config_get_global_options()->n_threads; int64_t size = canonical_stmt.size(); - if (size <= cache_max_size) + if (size < max_entry_size && size <= cache_max_size) { int64_t required_space = (m_stats.size + size) - cache_max_size; diff --git a/server/modules/monitor/csmon/csmon.cc b/server/modules/monitor/csmon/csmon.cc index 5cc632746..702a4a16d 100644 --- a/server/modules/monitor/csmon/csmon.cc +++ b/server/modules/monitor/csmon/csmon.cc @@ -58,17 +58,22 @@ static std::string do_query(MonitorServer* srv, const char* query) // Returns a numeric version similar to mysql_get_server_version int get_cs_version(MonitorServer* srv) { - // GCC 4.8 appears to have a broken std::regex_constants::ECMAScript that doesn't support brackets - std::regex re("Columnstore \\([0-9]*\\)[.]\\([0-9]*\\)[.]\\([0-9]*\\)-[0-9]*", - std::regex_constants::basic); - std::string result = do_query(srv, "SELECT @@version_comment"); - std::smatch match; int rval = 0; + std::string prefix = "Columnstore "; + std::string result = do_query(srv, "SELECT @@version_comment"); + auto pos = result.find(prefix); - if (std::regex_match(result, match, re) && match.size() == 4) + if (pos != std::string::npos) { - rval = atoi(match[1].str().c_str()) * 10000 + atoi(match[2].str().c_str()) * 100 - + atoi(match[3].str().c_str()); + std::istringstream os(result.substr(pos + prefix.length())); + int major = 0, minor = 0, patch = 0; + char dot; + os >> major; + os >> dot; + os >> minor; + os >> dot; + os >> patch; + rval = major * 10000 + minor * 100 + patch; } return rval; diff --git a/server/modules/protocol/MySQL/mariadb_client.cc b/server/modules/protocol/MySQL/mariadb_client.cc index e37c6bd0b..39e61299e 100644 --- a/server/modules/protocol/MySQL/mariadb_client.cc +++ b/server/modules/protocol/MySQL/mariadb_client.cc @@ -32,6 +32,8 @@ LocalClient::LocalClient(MYSQL_session* session, MySQLProtocol* proto, int fd) , m_self_destruct(false) { MXB_POLL_DATA::handler = LocalClient::poll_handler; + m_protocol.owner_dcb = nullptr; + m_protocol.stored_query = nullptr; } LocalClient::~LocalClient() diff --git a/server/modules/protocol/MySQL/rwbackend.cc b/server/modules/protocol/MySQL/rwbackend.cc index 738b5a93b..eb95ab855 100644 --- a/server/modules/protocol/MySQL/rwbackend.cc +++ b/server/modules/protocol/MySQL/rwbackend.cc @@ -304,6 +304,17 @@ void RWBackend::process_packets(GWBUF* result) auto end = std::next(it, len); uint8_t cmd = *it; + // Ignore the tail end of a large packet large packet. Only resultsets can generate packets this large + // and we don't care what the contents are and thus it is safe to ignore it. + bool skip_next = m_skip_next; + m_skip_next = len == GW_MYSQL_MAX_PACKET_LEN; + + if (skip_next) + { + it = end; + continue; + } + switch (m_reply_state) { case REPLY_STATE_START: diff --git a/server/modules/routing/avrorouter/avro_client.cc b/server/modules/routing/avrorouter/avro_client.cc index 72d328a0b..9d725f5a5 100644 --- a/server/modules/routing/avrorouter/avro_client.cc +++ b/server/modules/routing/avrorouter/avro_client.cc @@ -33,6 +33,7 @@ #include #include #include +#include std::pair get_avrofile_and_gtid(std::string file); @@ -238,22 +239,14 @@ bool file_in_dir(const char* dir, const char* file) } /** - * @brief The client callback for sending data - * - * @param dcb Client DCB - * @param reason Why the callback was called - * @param userdata Data provided when the callback was added - * @return Always 0 + * Queue the client callback for execution */ -int avro_client_callback(DCB* dcb, DCB_REASON reason, void* userdata) +void AvroSession::queue_client_callback() { - if (reason == DCB_REASON_DRAINED) - { - AvroSession* client = static_cast(userdata); - client->client_callback(); - } - - return 0; + auto worker = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN); + worker->execute([this]() { + client_callback(); + }, mxs::RoutingWorker::EXECUTE_QUEUED); } /** @@ -337,11 +330,7 @@ void AvroSession::process_command(GWBUF* queue) if (file_in_dir(router->avrodir.c_str(), avro_binfile.c_str())) { - /* set callback routine for data sending */ - dcb_add_callback(dcb, DCB_REASON_DRAINED, avro_client_callback, this); - - /* Add fake event that will call the avro_client_callback() routine */ - poll_fake_write_event(dcb); + queue_client_callback(); } else { @@ -733,7 +722,7 @@ void AvroSession::client_callback() if (next_file || read_more) { - poll_fake_write_event(dcb); + queue_client_callback(); } } diff --git a/server/modules/routing/avrorouter/avrorouter.hh b/server/modules/routing/avrorouter/avrorouter.hh index 50b45fdfc..5feda0b4b 100644 --- a/server/modules/routing/avrorouter/avrorouter.hh +++ b/server/modules/routing/avrorouter/avrorouter.hh @@ -173,11 +173,6 @@ public: */ int routeQuery(GWBUF* buffer); - /** - * Handler for the EPOLLOUT event - */ - void client_callback(); - private: AvroSession(Avro* instance, MXS_SESSION* session); @@ -190,6 +185,8 @@ private: bool seek_to_gtid(); bool stream_data(); void rotate_avro_file(std::string fullname); + void client_callback(); + void queue_client_callback(); }; void read_table_info(uint8_t* ptr,