Commit Graph

6610 Commits

Author SHA1 Message Date
ced063b1a0 MXS-1775 Fix GRMon to update pending_status
Instead of continuously updating the status of the server object,
the monitor should update the pending_status of the monitor object
and then only at the end update the status of the server object.
2018-06-01 13:48:15 +03:00
4b01656bef MXS-1775 Fix AuroraMonitor to update pending_status
Instead of continuously updating the status of the server object,
the monitor should update the pending_status of the monitor object
and then only at the end update the status of the server object.
2018-06-01 13:48:15 +03:00
8d1b8a1774 MXS-1775 Handle connection error the same way
All monitors (but for MariaDBMon) now handle connection errors in
the same manner.

An exception is MMMon that modifies both the server status and the
monitor status. However, in fact, all other monitors do it the wrong
way and update the server status directly instead of only the monitor
status that then at the end of the loop should be copied to the server
status.
2018-06-01 13:48:15 +03:00
5196371762 MXS-1775 Use same arrangement in update_server_status
All monitors (but possible for MariaDBMon) now handle the
connecting to the server in the same way, that is, if the
connecting fails, then the status is updated and we return.
2018-06-01 13:48:15 +03:00
df4e19eb27 MXS-1775 Provide default implementation for MonitorInstance::tick 2018-06-01 13:48:15 +03:00
68505a0bcb MXS-1775 Consistently name the argument to update_server_status() 2018-06-01 13:48:15 +03:00
cb1da5538c MXS-1775 Monitoring function named consistently
The main monitoring function now has the same name in all
monitors (except MariaDBMonitor) and is a member function.
2018-06-01 13:48:15 +03:00
af9beecaef MXS-1775 Handle config param disk_space_check_interval 2018-06-01 13:48:15 +03:00
938865de3d MXS-1775 Allow the setting of disk_space_threshold
Now disk_space_threshold can be set on servers and monitors.
2018-06-01 13:48:15 +03:00
11c04ff8a8 MXS-1775 Add disk space threshold to server and monitor
- Instance variable.
- Functions for setting it from configuration file.
2018-06-01 13:48:15 +03:00
cb8cd4be3d MXS-1775 Add helper function for parsing disk_space_threshold
The function will be used by the functions

    server_set_disk_space_threshold() and
    monitor_set_disk_space_threshold()

that will be introduced.
2018-06-01 13:48:15 +03:00
2ed631ab63 Merge branch '2.2' into develop 2018-06-01 13:46:03 +03:00
089be56103 MXS-1889 Only turn on master bit for slaves
The bitmask ensures that the master bit would be ignored in
cases where it is not relevant, but nicer if it is set only
when it is relevant.
2018-06-01 13:43:02 +03:00
d77a9a3040 MXS-1889 Handle master used as slave
Up until 2.1.12, if it in the configuration file said
'router_options=slave', the master was used if there were no
slaves at session creation time.

That broke in 2.1.13 as a side-effect of MXS-1516 that checks
at routing time whether the server initially selected as master
still is the master.

Now the required server status is stored separately for each
session, so that if the master was chosen, even though we have
'router_options=slave', we can turn on the SERVER_MASTER bit.

That allows us to handle the case correctly in connection_is_valid().
2018-06-01 11:00:13 +03:00
5d02d8c0ba Merge branch '2.2' into develop 2018-06-01 09:33:04 +03:00
89296ed4e4 MXS-1740 Hintfilter leaks memory
Single spot where an existing hint ptr was overwritten. Removed gwbuf_add_hint()
because it was  adding hints at the opposite end compared to functions in hint.h.
Added hint_splice() to replace.
2018-05-31 14:04:22 +03:00
c039821467 MXS-1883 Maintenance is now the only user-modifiable bit for a monitored server
The request to turn maintenance off/on is a separate flag, although the actual
status is still contained in the status bitfield.
2018-05-30 10:09:15 +03:00
2bbf1271c9 Fix large packet execution
The number of expected responses was not correctly tracked for large
packets.
2018-05-28 13:51:05 +03:00
5f167abafd Add missing priority usage information to galeramon
The monitor did not print the current value of this parameter and knowing
it is helpful.
2018-05-28 10:34:06 +03:00
be098538e5 MXS-1881: Read event header in a separate function
Reading the binlog event header in a separate function makes it easier to
comprehend. Cleaned up some unused variables and code that would is not
used.
2018-05-28 10:32:18 +03:00
5a3bbf0d15 Move binlog event processing into a separate file
This clarifies what parts of the router are specific to the binlogrouter
and what are common between the binlogrouter and avrorouter.

Ideally, the two modules would use the same infrastructure to handle the
processing of replication events. This is the first, albeit small, step
towards making the code in the binlogrouter the common infrastructure.
2018-05-28 10:32:18 +03:00
14a3b0052b MXS-1881: Perform task management in main worker
The creation and cancellation of delayed tasks must be done on the worker
where the task is executed.
2018-05-28 10:32:18 +03:00
ec919c367b Move Avro creation into Avro::create
The Avro instance is now created inside a static class method. This brings
it in line with how other modules create instances.

Converted all strings to std::string and updated their usage.
2018-05-28 10:32:17 +03:00
232d86e67a Make active table map array dynamic
By storing the table maps in a std::unordered_map, the storage of mapped
tables is made dynamic. This also makes the management of mapped tables a
lot more robust.
2018-05-28 10:32:17 +03:00
f8ceb875a0 Refactor TABLE_CREATE allocation
Using std::string for names removes the need to handle memory
allocation. Moving the column attributes into a class of its own greatly
simplifies the creation of the TABLE_CREATE as well as modifications that
are done to it.
2018-05-28 10:32:17 +03:00
d5760f4301 Move AvroSession initialization inside the class
The AvroSession now has the AvroSession::create method for creation new
sessions. The destructor handles the freeing of all allocated resources.
2018-05-28 10:32:16 +03:00
fb53bbf4da Use STL containers in avrorouter
The HASHTABLE can be replaced with std::unordered_map. This simplifies the
management by making the deletion of old objects automatic.

More cleanup and refactoring is needed to make the contained classes
cleaner.
2018-05-28 10:32:16 +03:00
a6eef98597 Initialize all AvroSession variables
This is done to get tests to pass before further refactoring is done.
2018-05-28 10:32:16 +03:00
6159f863ce Remove unnecessary locking
The lock didn't really protect anything but since it was not explicitly
initialized, it caused a hang.
2018-05-28 10:32:16 +03:00
3fce61a615 Do avro conversion in main thread
The avrorouter no longer uses the housekeeper for the conversion
task. This prevents the deadlock which could occur when clients were
notified at the same time that the binlogrouter was adding a master
reconnection task.
2018-05-28 10:32:16 +03:00
16d2ff9564 Set read and execute permissions for all paths
If a path requires read or execute permission, it is granted to all. This
keeps path parameters in line with other directories that MaxScale
creates.
2018-05-28 10:32:16 +03:00
6898397d49 Clean up avrorouter.hh
Cleaned up the header and removed most of unused member variables.
2018-05-28 10:32:15 +03:00
8dd89548f4 Fix avrorouter client notification
The avrorouter client notification now uses dcb_foreach.
2018-05-28 10:32:15 +03:00
3095b18b14 Convert avrorouter objects to C++
The instance and session objects are now C++ structs. The next pointers
for the sessions was removed as it is not the appropriate place to store
this information. This means that the client notification functionality is
broken in this commit.
2018-05-28 10:32:15 +03:00
354e9aeefc Clean up avrorouter files
Removed commented out code, manual revision notes and extraneous comments.
2018-05-28 10:32:15 +03:00
77c713baa6 Remove manual revision notes and extra files
Removed the manually written revision notes that were in some files. Also
removed the README and STATUS files which were present.
2018-05-28 10:32:14 +03:00
55e1a39cc3 MXS 173 Deprecate DBFW rule limit_queries
Replaced by throttle filter
2018-05-25 14:51:36 +03:00
40b31621c8 Merge branch '2.2' into develop 2018-05-25 12:15:58 +03:00
a705130708 MXS-1882: Make [maxscale] sections in sub-configs an error
Defining the [maxscale] section in a configuration file that is not the
root configuration file is now treated as an error instead of silently
ignored.
2018-05-24 13:01:57 +03:00
0848bedf34 Add comment to static_assert
The C++11 version requires a second parameter.
2018-05-24 12:49:19 +03:00
a2cd4feeaf Store server states as 64-bit to the monitor journal
The journal schema version was changed.
2018-05-24 11:35:34 +03:00
f8940d4a2a Use 64bits for server status flags
Monitor journal still uses 32bits.
2018-05-23 16:19:08 +03:00
3ec449339f Only write to SERVER->status at the end of a monitoring loop
This makes the code clearer and reduces race conditions, as the monitor
could be writing SERVER->status while a router is reading it. Also,
the time during which the SERVER struct is locked drops to a fraction.
2018-05-23 16:19:08 +03:00
715b8a6f1d Fix CentOS 6 build failures
testrules.cc had a signed to unsigned comparison and it used lambda
functions (which are not supported in CentOS 6).

The keywords struct in hintparser.cc needed to be declared static in order
for it to compile.
2018-05-23 13:09:15 +03:00
d9b61f9f15 Use std::list instead of std::deque
The copying of a std::deque appears to cause problems on CentOS 6. Using
an std::list seems to work without problems.
2018-05-23 13:09:15 +03:00
88380038c1 Fix regression in handling of large packets
When large binary protocol packets were handled, a part of the data was
replaced with a non-existing PS ID.

The replacement of the client PS ID to the internal ID and the replacement
of the internal ID to the server specific ID must only be done if a large
packet is not being processed. This can be done on the router level
without adding knowledge of large packets to the RWBackend class.

A specific function, RWBackend::continue_write, was added to make it clear
that the buffer being written is a part of a larger query. The base class
Backend::write could be used but its usage is not self-explanatory.
2018-05-22 17:46:27 +03:00
a33f09ad06 Fix test failures and add debug logging
Fixed test failures, increased some of the timeouts, added extra info
level logging into rwsplit to help debug the test failures.
2018-05-22 17:46:27 +03:00
b451e89e35 Use Worker::delayed_call in session_delay_routing
The use of the housekeeper is no longer needed as a better mechanism
exists.
2018-05-22 17:46:27 +03:00
730fd9f30d MXS-1778: Rename variables and change default values
The causal read timeout now has a default value of 120 seconds. Removed
the redundant `enable` part from the names of the member variables.
2018-05-22 17:46:26 +03:00
4ba0ac434b MXS-1778: Add support for MariaDB GTID tracking
The MariaDB implementation allows the last GTID to be tracked with the
`last_gtid` variable. To do this, the configuration option
`session_track_system_variables=last_gtid` must be used or it must be
enabled at runtime.
2018-05-22 17:46:26 +03:00