Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-37476

Read replica replication error because virtual column is out of range

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4.7
    • None

    Description

      Today around 01:31 I found that one read replica stop to replicate.

      I found that for some weird reason the replica was unable to replicate one insert operation with the following error:

      Read Replica Replication Error - SQLError: 1264, reason: Error &aposOut of range value for column 'age' at row 1' on query.
      

      It seems that replica attempts to insert a record into a table that uses virtual column.

      Example of table DDL:

      CREATE TABLE `test_table` (
        `id` uuid NOT NULL,
        `birth_date` date DEFAULT NULL,
        `age` tinyint(3) unsigned GENERATED ALWAYS AS (timestampdiff(YEAR,`birth_date`,coalesce(`register_at`,current_timestamp()))) VIRTUAL,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
      

      In the master the value used for the birthday was 1688-04-01 and the age was 255 because was out of range, however the read-replica was unable to replicate the master and raised

      I understand that column age is out of range for this case but it should fails first on the master server.

      My workaround was to re-create the replica from scratch.

      Note: Master and Read-replica uses exactly the same version 11.4.7

      Attachments

        Activity

          People

            Unassigned Unassigned
            juanparati Juan Lago
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.