Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-6581

KafkaCDC causes segfault when processing geometry datatype events

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 23.02.17
    • None
    • kafkacdc
    • None
    • Rocky 9 Linux

    Description

      Summary
      KafkaCDC aborts when processing row events containing spatial geometry columns (POINT)

      Environment
      MaxScale: 23.02.17

      MariaDB Server:

      • 11.4.12
      • 10.11.x

      Kafka: 4.3.0

      OS:
      Rocky Linux 9.8 (Blue Onyx)

      MariaDB Configuration:

      ```
      [mariadbd]
      server_id=1
      log-bin
      binlog_format=ROW
      binlog_row_image=FULL
      ```

      CDC Service Configuration

      ```
      [CDC-Service]
      type=service
      router=kafkacdc
      servers=server1
      user=<username>
      password=<password>
      bootstrap_servers=cdc_broker:9092
      topic=cdc-topic
      match=cdc_test[.].*
      ```

      Description

      KafkaCDC aborts while processing row events containing geometry data types.

      The issue was isolated from a larger schema by progressively reducing the test environment until a minimal reproducer was found.

      CDC functions correctly for ordinary scalar types such as INT and VARCHAR. The failure only occurs when a row event contains a geometry value.

      Expected Behavior

      KafkaCDC should either:

      • Successfully publish row events containing geometry values, or
      • Reject unsupported geometry types with a logged error.

      In either case, MaxScale should continue running.

      Actual Behavior

      When a row containing a geometry value is inserted, MaxScale aborts with fatal signal 6 while processing the row event.

      Reproduction Steps
      Create a test database:

      ```
      CREATE DATABASE cdc_test;
      USE cdc_test;
      ```

      Create a table containing a geometry column:

      ```
      CREATE TABLE t1 (
      id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
      geom POINT
      );
      ```

      The table creation succeeds and does not trigger the failure.

      Insert a geometry value:

      ```
      INSERT INTO t1 (geom)
      VALUES (ST_GeomFromText('POINT(1 2)'));
      ```

      MaxScale aborts while processing the resulting row event.

      Control Case

      The same KafkaCDC configuration functions correctly when only scalar data types are used.

      Example:

      ```
      CREATE TABLE scalar_test (
      id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
      msg VARCHAR(64)
      );

      INSERT INTO scalar_test (msg)
      VALUES ('hello');
      ```

      In this case:

      • CDC topic is created successfully
      • CDC messages are published successfully
      • MaxScale remains running

      Stack Trace

      ```
      MaxScale 23.02.17 received fatal signal 6. Commit ID: e98e370325d228dd2ad3f885e78c15a1f059e56f, System name: Linux, Release string: Rocky Linux 9.8 (Blue Onyx), Thread: cdc::Replicator

      nm: 'maxscale': No such file
      addr2line: 'maxscale': No such file
      nm: 'maxscale': No such file
      addr2line: 'maxscale': No such file
      addr2line: 'maxscale': No such file

      maxscale(_ZN7maxbase15dump_stacktraceESt8functionIFvPKcS2_EE+0x2b):
      maxscale(_ZN7maxbase15dump_stacktraceEPFvPKcS1_E+0x42):
      maxscale():
      /lib64/libc.so.6(+0x3fc60): ??:?
      /lib64/libc.so.6(+0x8d21c): ??:?
      /lib64/libc.so.6(raise+0x16): :?
      /usr/lib64/maxscale/libreplicator.so.1.0.0(ZN3Rpl22process_row_event_dataERK5TablePhS3_S3+0x1d12): server/modules/routing/replicator/rpl.cc:1876
      /usr/lib64/maxscale/libreplicator.so.1.0.0(_ZN3Rpl16handle_row_eventEP10REP_HEADERPh+0x546): /usr/include/c++/11/bits/unique_ptr.h:173
      /usr/lib64/maxscale/libreplicator.so.1.0.0(_ZN3Rpl12handle_eventE10REP_HEADERPh+0x5f): server/modules/routing/replicator/rpl.cc:2234
      /usr/lib64/maxscale/libreplicator.so.1.0.0(_ZN3cdc10Replicator3Imp17process_one_eventERSt10unique_ptrI20st_mariadb_rpl_eventSt8functionIFvPS3_EEE+0xbf): server/modules/routing/replicator/replicator.cc:606
      /usr/lib64/maxscale/libreplicator.so.1.0.0(_ZN3cdc10Replicator3Imp14process_eventsEv+0x34e): /usr/include/c++/11/bits/atomic_base.h:488
      /lib64/libstdc++.so.6(+0xdbae4): ??:?
      /lib64/libc.so.6(+0x8b3f9): ??:?
      /lib64/libc.so.6(+0x1105d0): :?

      Writing core dump.
      /app/run_maxscale.sh: line 46: 4 Aborted (core dumped)
      ```

      Additional Notes

      The issue reproduces with a simple POINT column and does not require any complex geometry structures.

      The failure does not occur during:

      • Database creation
      • Table creation
      • Kafka broker startup
      • CDC service startup

      The failure occurs only when KafkaCDC processes a row event containing a geometry value.

      Attachments

        Activity

          People

            Unassigned Unassigned
            wneill Wesley Neill
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.