Commit Graph

11034 Commits

Author SHA1 Message Date
e80a145b2c Remove passwd from bundled configurations
The configurations still used the old parameter name.
2018-07-17 11:52:17 +03:00
def8cb5071 Add C++ helper for SSH output
The ssh_output function returns a string and takes a std::string as the
ssh command parameter.
2018-07-17 11:52:17 +03:00
4bf6233d2a Drop created tables in tests
If a table is created in a test, it should also drop the table.
2018-07-17 11:52:17 +03:00
12b4f67f30 Skip mxs421_events if syslog doesn't log to file
The test cannot work unless syslog writes to a file.
2018-07-17 11:52:17 +03:00
3078da3992 Make use of router_options in readwritesplit an error
As the router_options have been deprecated in 2.2 and removed in 2.3,
using them in readwritesplit is an error.
2018-07-17 11:52:16 +03:00
e963f4e82b Fix reading of past-the-end memory
The buffer that binlogrouter allocated for the error message was too
small. ASAN happened to catch this.
2018-07-17 11:52:16 +03:00
4162116109 Remove router_options from readwritesplit tests
The router_options parameter is no longer accepted by readwritesplit.
2018-07-17 11:52:16 +03:00
5fdf82a508 Only warn about whitespace in section names
The warnings were logged even when the fix_section_name function was used
to fix non-section names.
2018-07-17 11:52:15 +03:00
fa6bcefdb0 Remove unused file
The doxygen.c file was not used nor updated.
2018-07-17 11:52:15 +03:00
4a0ace2a72 Use module-style parameters with monitors
The common monitor parameters are now stored as module-style
parameters. This makes the error reporting as well as the type checks for
the parameters consistent with parameters declared by the modules.
2018-07-17 11:52:15 +03:00
dd8402dd94 Update binlogrouter test configurations
Updated the binlogrouter test configurations to use correct options. Also
removed commented out sections and obsolete configurations.
2018-07-17 11:52:15 +03:00
d51a21faf7 Remove passwd from test configurations
As the parameter will be removed in 2.3, the test configurations need to
be updated.
2018-07-17 11:52:14 +03:00
f807c21242 Treat service parameters as module parameters
The same mechanism that is used for modules can be used for the
configuration of the core objects. This removes the need for the redundant
code that validates various values that is already present in the code
that modules use.
2018-07-17 11:52:14 +03:00
f2e0bf3caa Factor out functions
The topology update is now in a method. Also, the m_master-field
is only written inside a method so that the cycle info is always
updated.
2018-07-16 15:58:16 +03:00
936bcde135 Remove old "detect_standalone_master"-feature, update documentation
The auto_failover is a more reliable solution and should be used instead. Several
unused parameters were removed, although they can still be defined in the config
file. Updated documentation on the relevant parts.
2018-07-16 15:58:16 +03:00
f7538db3b7 Fix release-mode compile error
Caused by merging 2.2.
2018-07-16 15:40:08 +03:00
1811503a13 Merge branch '2.2' into develop 2018-07-15 21:22:27 +03:00
19a349a4a8 MXS-1976: Explain shutdown service behavior
The process of stopping a service will not prevent new connections from
being created. The documentation needs to be extended so that the meaning
of `accepted` is explicitly and clearly stated.
2018-07-15 21:04:03 +03:00
2acf5f545e MXS-1066 Add query hint to route to last used server
Add new hint type and support for it in the readwritesplit router.
2018-07-13 11:11:02 +03:00
e2fb0093b1 Merge branch '2.2' into develop 2018-07-12 19:38:40 +03:00
71c736faec Initialize router parameters in service_alloc
By moving the router parameter initialization into service_alloc, the
creation of a new service can be simplified to a single function call.
2018-07-11 14:08:56 +03:00
81527894ee Remove filter options
None of the filters used the options. The filter API version was already
incremented once for 2.3 so there's no need to increment it again.
2018-07-11 14:08:56 +03:00
cbb8c68770 Remove router_options
Relaced router_options with configuration parameters in the createInstance
router entry point. The same needs to be done for the filter API as barely
any filters use the feature.

Some routers (binlogrouter) still support router_options but using it is
deprecated. This had to be done as their use wasn't deprecated in 2.2.
2018-07-11 14:08:56 +03:00
f11f8980b2 Use mxs::strtok in readconnroute
The configuration can be simplified by using the string tokenization
function.
2018-07-11 14:08:55 +03:00
e353d14550 Prepare binlogrouter for removal of router_options
To prepare the router's for the eventual removal of the router_options
parameter, the API option arguments should not be used. The parameters can
be substituted by tokenizing the value of the parameter that is still
stored as a part of the service.
2018-07-11 14:08:55 +03:00
b320217212 Remove configuration reloading
Removed the deprecated configuration reloading code. Added a entry into
the release notes that states this and the fact that it was deprecated in
2.2.
2018-07-11 14:08:54 +03:00
904b7d9d39 Remove unused service code
The code was not used and is not needed.
2018-07-11 14:08:54 +03:00
313bb0a5b4 Fix alteration of new router parameters
If a router parameter has no default value, the previous value would be
returned as an empty string. A debug assertion would be triggered when a
parameter of this type was altered.

When a new router parameter is encountered and the alteration fails, the
modified value in the service need to be removed. Previously, the new
value would have been stored in the service with an empty value which
would have caused problems.
2018-07-11 14:08:53 +03:00
151c7e19f4 Add schemarouter reconfiguration test
Extended the alter_router test to check that modifications to schemarouter
are processed correctly.
2018-07-11 14:08:53 +03:00
5903e194a7 Add runtime schemarouter reconfiguration
The schemarouter now also uses versioned configurations implemented by
shared pointers to configuration objects. Moved all the configuration
management into the Config class. Removed router options from
schemarouter.
2018-07-11 14:08:52 +03:00
7f67fe6f14 Add string tokenization helper
The mxs::strtok function splits a string into a vector of strings based on
a set of delimiters. The function makes it easier to iterate over a set of
values given as a delimited string.
2018-07-11 14:08:52 +03:00
6d663c79ac Extend router alteration test
Extended the test to cover modifications to readconnroute as well as do
checks on detection of invalid parameters.

Also allowed modifications to router_options at runtime.
2018-07-11 14:08:52 +03:00
c4be3f75c0 Add readconnroute runtime reconfiguration
Readconnroute can now be configured at runtime. The changes to
configuration processing allow the removal of router_options now that the
parameters are parsed inside the router.
2018-07-11 14:08:51 +03:00
5604023b26 Clean up readconnroute structures
Removed unused member variables and reduced debug output.
2018-07-11 14:08:51 +03:00
f2e44eb5e2 Add missing newline to mysqlmon stress test assertions
The tests did not add a new line to the assertion output which would
explain why no output from the test itself was given.
2018-07-11 14:08:50 +03:00
f3c84d84c7 Fix transaction migration
The transaction migration in the case of a changed master never worked as
transaction replay would only be triggered when the master fails. To cover
this case, the transaction replay just needs to be started when the need
for a transaction migration is detected.

To help diagnose the behavior, the Trx class no longer logs a message when
a transaction is closed. This is now done by readwritesplit which has more
knowledge of the context in which the transaction is closed.
2018-07-11 14:08:50 +03:00
98e233bb33 Minor cleanup of route_single_stmt
Moved transaction statistics calculations into a member function and
placed all target type specific processing into their respective
functions.

Also inverted the connection keepalive check to also cover hinted queries.
2018-07-11 14:08:50 +03:00
616fb30818 Add basic router alteration test
The test checks that alterations to routers work and are persisted.
2018-07-11 14:08:49 +03:00
1e68261bce Add missing handling of max_slave_connections
The parameter accepts both counts and percentages which requires special
handling in the router. This needs to be done when the configuration is
updated.
2018-07-11 14:08:49 +03:00
30d3dcfd4e Persist router parameters
Router parameters are now correctly persisted after they have been
modified.
2018-07-11 14:08:48 +03:00
861b0857cd Use correct type for transaction_replay_max_size
transaction_replay_max_size is a size, not a count.
2018-07-11 14:08:48 +03:00
881c49c57d Fix mxs729_maxadmin
The results returned appear to be inverted with C++11 version of an
unordered map.
2018-07-11 14:08:47 +03:00
86cdb14286 Don't process queued commands when replaying transaction
If a transaction is replayed, queued commands must not be processed. The
exception to this rule is when pending session commands are executed
before the first statement in the replayed transaction is executed.
2018-07-11 14:08:47 +03:00
0614ff4c9d Fix handling of transactions with large results
If transaction replaying was enabled and a result was returned in more
than one call to clientReply, a NULL value would be added to the statement
which in turn would trigger a debug assertion.

Similarly any following statements in the transaction would be executed
regardless of whether the result was complete.

Renamed the statement execution function to better describe what it does.

Extended the basic functional test case to cover this.
2018-07-11 14:08:47 +03:00
77a1417479 Replace TR1 headers with standard headers
Now that the C++11 standard is the default one, we can remove the TR1
headers and classes.
2018-07-11 14:08:46 +03:00
28ceb1bad8 Take router reconfiguration into use
The router parameters can now be reconfigured at runtime if the router
supports it. Both MaxAdmin and the REST API support it.
2018-07-11 14:08:46 +03:00
a5e384fd29 Add reconfiguration to router API
Added a new router API entry point that allows configuration changes after
the instance has been created. This makes alterations to most service
parameters at runtime possible.

An option to reconfiguration would have been the creation of a new
service and the eventual destruction of the old one. This would be a more
complicated and costly method but from an architectural point of view it
is interesting.

The actual implementation of the configuration change is left to the
router. Currently, only readwritesplit performs reconfiguration as
implementing it with versioned configurations is very easy.

Versioned configurations can be considered an adequate first step but it
is not an optimal solution as it causes a bottleneck in the reference
counting of the shared configuration. Thread-specific configuration
definitions would make for a more efficient solution but the
implementation is more complex.
2018-07-11 14:08:45 +03:00
bd4be3a97b Use shared configurations in readwritesplit
By using a shared pointer instead of a plain object, we can replace the
router configuration without it affecting existing sessions. This is a
change that is required to enable runtime reconfiguration of
readwritesplit.
2018-07-11 14:08:45 +03:00
2d4dbb2117 Refer to runtime configuration in the configuration guide
The configuration guide now links to the runtime configuration in the TOC
instead of the deprecated legacy configuration reloading. The new section
lists the currently supported methods for altering the configuration at
runtime.
2018-07-09 21:09:16 +03:00
13763ace32 MXS-1820 Make routing of queries in schemarouter case insensitive 2018-07-09 16:18:18 +03:00