[MXS-2106] Maxscale CDC JSON output does not respect null values Created: 2018-10-18 Updated: 2018-11-08 Resolved: 2018-11-08 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | avrorouter, cdc |
| Affects Version/s: | 2.2.14 |
| Fix Version/s: | 2.2.17 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergiy Kyrychenko | Assignee: | markus makela |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Maxscale 2.2.14 connecting to MariaDB 10.1 for CDC |
||
| Description |
|
I have a MariaDB 10.1 database and I've installed and configured Maxscale 2.2.14 to try BinlogRouter, Avrorouter, and CDC Protocol. The problem is with JSON output from CDC Protocol. It seems that null values are not coming out as nulls but rather zeroes and empty strings on insert, and when value is updated to null, after_update event has old value reported instead of null or 0. Below are sample table and DML statements, relevant CDC Protocol output, maxscale.cnf and binlog/master.ini. Any help would be appreciated.
-------------------------------------------------------------
-------------------------------------------------------------
-------------------------------------------------------------
|
| Comments |
| Comment by markus makela [ 2018-10-29 ] |
|
Managed to reproduce this, appears to be caused by either the generated Avro schema and/or the client library. |
| Comment by Sergiy Kyrychenko [ 2018-10-29 ] |
|
Can this be worked around by supplying custom avro spec to the router instead of generated one? I tried it and could not figure out proper format for avsc file to handle nulls. |
| Comment by markus makela [ 2018-10-29 ] |
|
I tried a quick fix of turning all values into union types but that didn't seem work with the Avro C client library and caused other sorts of errors. I'll continue investigating this but at this point it looks like there's no workaround. |
| Comment by markus makela [ 2018-11-01 ] |
|
Turns out that the union value handling in the C API had a different functionality from the normal values and I simply misunderstood how it worked. With a set of changes to the avrorouter and associated libraries, NULL values can be properly handled. The fix to this is currently on the |
| Comment by markus makela [ 2018-11-01 ] |
|
Here are the packages that can be used for testing: http://max-tst-01.mariadb.com/ci-repository/MXS-2.2-markusjm-nov1/mariadb-maxscale/ These haven't gone through full regression testing so they should not be used in production environments. |
| Comment by Sergiy Kyrychenko [ 2018-11-01 ] |
|
That is great news. I'll try it in my environment. One question though: [DIR] 7/ 2018-11-01 11:52 - |
| Comment by markus makela [ 2018-11-01 ] |
|
They are all the same, those are just symbolic links that some operating systems required. |
| Comment by Sergiy Kyrychenko [ 2018-11-02 ] |
|
Fix seems to work. Looking forward for 2.2.17 release. Thanks for addressing it in such a short time. |
| Comment by Sergiy Kyrychenko [ 2018-11-02 ] |
|
Are you planning to update MaxScale/server/modules/protocol/examples/cdc_schema.py and MaxScale/server/modules/protocol/examples/cdc_schema.go so that correct schema files can be generated for existing tables? |
| Comment by markus makela [ 2018-11-02 ] |
|
Oh yes, those seem to have slipped past me. I'll fix them immediately. |