This prevents some questionable status assignments, but also means that
the Relay Master status can be lost if a slave goes down. This is
contrary to Master status which is not lost if slaves go down. Fixes
mxs1961_standalone_rejoin.
The combined effort of all workers of updating EMAverage is needed for precision,
statistics and making parts of it adaptive (rather than hardcoded or configured).
Fix comments.
Fix a bug in make_valid().
Change sync time (when the average should be pushed to the server EMA)
to only depend on time, not use sample_max. This decreases the amount of
sync calls, and allows for a much shorter sync time. Testing shows this to be
more stabel and allows to make sample_max adaptive .
The binlogrouter uses buffers across worker threads which is no longer OK
in 2.3. The correct solution would be to store data in something other
than a GWBUF (e.g. std::vector) and protect the sharing with a mutex. The
current solution simply works around the assertions by using macros
instead of functions.
Several small changes:
Binlog is flushed at the end of old master demotion.
Only new master is required to catch up to old master.
Use the same replication check method as failover.
Fix comments.
Fix a bug in make_valid().
Change sync time (when the average should be pushed to the server EMA)
to only depend on time, not use sample_max. This decreases the amount of
sync calls, and allows for a much shorter sync time. Testing shows this to be
more stabel and allow better control of the sample_max.
As buffers are meant to be used only within a particular session, the
atomic operations are no longer necessary and can thus be removed. This
removes the extra overhead that the atomic operations add.
By biasing the values of all counter type scores to positive integers, the
server weights are always taken into use.
This fixes the case when weights were ignored until all score base values
were larger than zero (the mxs922_server test).
If the DCB is closed in handleError, it would be NULL in closeSession. To
only close the DCB in one place, the handleError can be reduced to writing
an error to the client and marking the failure as a fatal one.
The reads now read as much of the data as is available to reduce the
number of distinct malloc calls that need to be made. The SSL_read also
now allocates the buffer before reading into it so that the amount of
copying is reduced.
Also removed some of the not quite helpful debug messages.
No longer writes events to the master, as this creates problems if the
promoted server was not the overall master. Instead, the slave status
output is inspected.
If the log file is successfully opened, both stdout and stderr are
redirected to it. This helps catch ASAN reports without having to read the
system journal files.
As the output is redirected to a file, some of the output was made visible
only in non-daemon mode. This helps keep the log file clean and readable.
The client connections had the Nagle algorithm enabled which could cause
bad performance with smaller workloads. The common network configuration
code in utils.cc, currently used by the backend connections, sets it
properly.
Clean up, comments and enhancements. StopWatch lap() didn't mean lap-time, but elapsed time. Changed meaning to lap-time and added split() for split-time.
The check for a closed session should never be needed as the core
correctly orders the calls to the module functions. The version numbering
was also not used.
Fixed the incrementation of the query counter so that it uses relaxed
atomic operations.
Replaced SPINLOCK with std::mutex where possible, leaving out the more
complex cases. The big offenders remaining are the binlogrouter and the
gateway.cc OpenSSL locks.