We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VReplication doesn't copy timestamp column with default current_timestamp
create table toki_test3 ( id varchar(3) NOT NULL, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(`id`) );
insert into src.toki_test3 values ('AAA', NULL); insert into src.toki_test3 values ('BBB', NULL);
select * from src.toki_test3; +-----+---------------------+ | id | created | +-----+---------------------+ | AAA | 2021-09-02 11:41:53 | | BBB | 2021-09-02 11:41:54 | +-----+---------------------+
vtctlclient MoveTables -source src -tables toki_test3 Create dest.test
select * from dest.toki_test3; +-----+---------------------+ | id | created | +-----+---------------------+ | AAA | 2021-09-02 11:45:13 | | BBB | 2021-09-02 11:45:13 | +-----+---------------------+
The created value is not the same as origin table, seems VReplication didn't copy the values of created column from origin table.
created
Vitess V11 release
This issue may caused by PR #8129
The copied table schema has an extra info DEFAULT_GENERATED (the origin table didn’t)
DEFAULT_GENERATED
desc toki_test3; +---------+------------+------+-----+-------------------+-------------------+ | Field | Type | Null | Key | Default | Extra | +---------+------------+------+-----+-------------------+-------------------+ | id | varchar(3) | NO | PRI | NULL | | | created | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED | +---------+------------+------+-----+-------------------+-------------------+
Via these codes (merged from #8129 )
vitess/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go
Line 296 in 6b52e98
vitess/go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go
Line 340 in 332223c
The created timestamp column seems will be ignored during replication because Vitess think it is a generated column
The text was updated successfully, but these errors were encountered:
This was resolved via #8763 and #8796.
Thank you so much for the great issue and PR, @tokikanno !
Sorry, something went wrong.
tokikanno
No branches or pull requests
Overview of the Issue
VReplication doesn't copy timestamp column with default current_timestamp
Reproduction Steps
The
created
value is not the same as origin table, seems VReplication didn't copy the values ofcreated
column from origin table.Binary version
Vitess V11 release
Related slack threads
Possible reason
This issue may caused by PR #8129
The copied table schema has an extra info
DEFAULT_GENERATED
(the origin table didn’t)Via these codes (merged from #8129 )
vitess/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go
Line 296 in 6b52e98
vitess/go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go
Line 340 in 332223c
The
created
timestamp column seems will be ignored during replication because Vitess think it is a generated columnThe text was updated successfully, but these errors were encountered: