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

Virtual column and RBR (Galera Cluster)

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.0.16-galera
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      RHEL6

      Description

      Try to add virtual column in to an existing table. The server is one of the node in a galera cluster, which is RBR.

      It's a live table, and update/insert cannot be stopped. Alter table with add new virtual column by RSU without any issue. New row is coming in without problem. However, all PERSISTENT virtual column value will become null, VIRTUAL one is populated without issue.

      It may be make sense for these columns become null if it is RBR? but how can I fix this null value after all server have the new table structure?

      Are there any statement I can run to force the DB to re-calculate the PERSISTENT virtual column?

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment - - edited

            If I understand the problem correctly, my suggestion would be to try to run ALTER TABLE ... MODIFY <initial virtual column definition>.
            For example, the initial table was
            create table t1 (a int)
            Then you added
            alter table t1 add vcol int as (a+5) persistent
            Then it got populated with (1,NULL) through the replication
            Then you run
            alter table t1 modify vcol int as (a+5) persistent
            It should become (1,6).

            But I will assign the issue to Nirbhay, maybe he can think of a more elegant solution, from Galera cluster perspective (The problem is not specific to Galera cluster, it would be the same if lets say the table was altered on the slave in a normal replication; but when it's done people who introduce such differences between master and slave are supposed to take care about possible problems, while with Galera it should generally "just work").

            Show
            elenst Elena Stepanova added a comment - - edited If I understand the problem correctly, my suggestion would be to try to run ALTER TABLE ... MODIFY <initial virtual column definition> . For example, the initial table was create table t1 (a int) Then you added alter table t1 add vcol int as (a+5) persistent Then it got populated with (1,NULL) through the replication Then you run alter table t1 modify vcol int as (a+5) persistent It should become (1,6). But I will assign the issue to Nirbhay, maybe he can think of a more elegant solution, from Galera cluster perspective (The problem is not specific to Galera cluster, it would be the same if lets say the table was altered on the slave in a normal replication; but when it's done people who introduce such differences between master and slave are supposed to take care about possible problems, while with Galera it should generally "just work").

              People

              • Assignee:
                nirbhay_c Nirbhay Choubey
                Reporter:
                leomkkwan Leo Kwan
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: