18 Commits

Author SHA1 Message Date
Markus Mäkelä
08a05d3ab9
Fix use of uninitialized variables
Building with optimization in debug mode revealed code that could in
theory result in undefined behavior.
2019-02-06 14:22:24 +02:00
Markus Mäkelä
75ea1b6ea1
Fix formatting of new(std::nothrow)
The code previously formatted everything as `new( std::nothrow)`.
2018-10-04 21:50:44 +03:00
Markus Mäkelä
4e41978069
Merge branch '2.2' into develop 2018-09-14 10:41:43 +03:00
Niclas Antti
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
Johan Wikman
ab9a9f92cb MXS-2020 Remove maxscale/debug.h
- Removed from all files.
- maxbase/assert.h included where necessary.
2018-08-22 11:35:35 +03:00
Johan Wikman
cf0aeed516 MXS-2014 Rename log_manager.h to log.h
There's nothing resembling a manager anymore.
2018-08-17 10:59:37 +03:00
Johan Wikman
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
Markus Mäkelä
95935991ab
MXS-1881: Move Rpl related code out of Avro files
Organized the Rpl and Avro code in a way that they aren't mixed.
2018-06-16 23:29:40 +03:00
Markus Mäkelä
3417842e75
MXS-1881: Add table creation method to RowEventHandler
The new method is called for each new CREATE TABLE statement that is
processed as well as all ALTER TABLE statemets that modify the table
structure.

Right now the entry point not in use but it opens up the possibility of
persisting the CREATE TABLE statements at creation time. Currently the
tables are only persisted when the first actual event for the table is
received.
2018-06-16 23:29:39 +03:00
Markus Mäkelä
e74591cfe5
MXS-1881: Delegate event processing to the Rpl class
The actual processing of the replicated events is now delegated to the Rpl
class. This class only deals with the raw binary format log events which
allows it to be used for both binlogs stored on disk as well as binlogs
that have just been replicated.
2018-06-16 23:29:39 +03:00
Markus Mäkelä
7c18696608
Abstract all row event processing
The code that handles the Avro files is now fully abstracted behind the
AvroConverter class that implements the RowEventHandler interface.

The code still has some avro specific behavior in a few places (parsing of
JSON files into TableCreate objects). This can be replaced, if needed, by
querying the master server for the CREATE TABLE statements.
2018-06-08 12:18:14 +03:00
Markus Mäkelä
8fab725413
MXS-1881: Move RBR objects into a separate header
The RBR event handling related objects are now all in the rpl_events.hh
header. The intention is to combine all replication processing related
events used in the binlogrouter and avrorouter into this header to make
them reusable.

Also fixed the TableCreateEvent constructor to use an rvalue instead of
stealing an lvalue.
2018-06-08 12:18:12 +03:00
Markus Mäkelä
c56b2063aa
MXS-1881: Rename event processing related objects
The main objects involved in replication event processing now use camel
case.
2018-06-08 12:18:11 +03:00
Markus Mäkelä
f61c56228c
MXS-1881: Refactor TABLE_MAP initialization
Changed TABLE_MAP to use STL containers and types. The initialization is
now done in the constructor. Removed unnecessary linkage between TABLE_MAP
and TABLE_CREATE.
2018-06-08 12:18:11 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Johan Wikman
1f6cc6db8a MXS-1840 Compile all routers as C++
Minimal changes, only what is needed in order to make it compile.
2018-05-07 14:06:22 +03:00