[MDEV-7647] Virtual column and RBR (Galera Cluster) Created: 2015-02-27 Updated: 2017-01-01 Resolved: 2017-01-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication, Virtual Columns |
| Affects Version/s: | 10.0.16-galera |
| Fix Version/s: | 10.0.29, 10.1.21, 10.2.4, 10.0.29-galera |
| Type: | Bug | Priority: | Major |
| Reporter: | Leo Kwan | Assignee: | Sachin Setiya (Inactive) |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Environment: |
RHEL6 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Sprint: | 5.5.54 | ||||||||
| 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? |
| Comments |
| Comment by Elena Stepanova [ 2015-02-28 ] |
|
If I understand the problem correctly, my suggestion would be to try to run ALTER TABLE ... MODIFY <initial virtual column definition>. 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"). |
| Comment by Marko Mäkelä [ 2016-12-15 ] |
|
For what it is worth, I was confused by the terminology. In MySQL 5.7, there are three kinds of columns:
It appears that PERSISTENT is the same as GENERATED STORED. From the storage engine point of view, the table schema is changing. Some corner cases:
The SQL layer is responsible for ensuring that GENERATED STORED columns are consistently updated and stored. On read, the column values will be returned by the storage engine. It appears to me that the replication log should include values for PERSISTENT columns, If the values of VIRTUAL columns are omitted, the replication slave must evaluate them for those VIRTUAL columns that are indexed. |
| Comment by Sachin Setiya (Inactive) [ 2017-01-01 ] |
|
http://lists.askmonty.org/pipermail/commits/2016-December/010331.html |