-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
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: _vt.vreplication source column VARBINARY->BLOB #6421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now have a framework (and a policy) for upgrades. They should always be alter statements on top of the existing ones. The withddl
package should be used to for managing the upgrades.
Having said that, there are more problems with this table than just this blob. I'd prefer that we design and work on a single consolidated fix to minimize the number of alters one has to apply for upgrades.
@sougou ok, do we have some consolidated idea of what a redesign of this table might look like? |
@rohit-nayak-ps and I discussed some ideas, and some of the thoughts are in @shlomi-noach issue #6352. Essentially, we need to sit down and hash this out. But there have been other priorities. |
This particular change itself is harmless because the change is backward compatible. But I'm worried about different versions of the table floating around, which can cause uncertainty during troubleshooting. Instead, we should just prioritize the refactoring of this table and fix all the other problems that exist with it. So, I propose that we close this PR for now. |
@sougou |
@teejae use
give or take |
8acecd2
to
5515a02
Compare
Signed-off-by: Toliver Jue <toliver@planetscale.com>
5515a02
to
0717e81
Compare
@shlomi-noach thanks for the pointers. @sougou back to you. |
@@ -533,6 +533,11 @@ var AlterVReplicationTable = []string{ | |||
"ALTER TABLE _vt.vreplication ADD COLUMN db_name VARBINARY(255) NOT NULL", | |||
} | |||
|
|||
// AlterVReplicationTableSourceToBlob changes source column of vreplication table to BLOB | |||
var AlterVReplicationTableSourceToBlob = []string{ | |||
"ALTER TABLE _vt.vreplication MODIFY source BLOB NOT NULL", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should just be part of AlterVReplicationTable
. The comment // AlterVReplicationTable adds new columns to vreplication table
is misleading: AlterVReplicationTable
is about all transformation post-CREATE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, i debated whether it belongs there. i figured we wanted to keep order of all migration steps...just in case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anything, putting all statements into the same array is the best guarantee for order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was wondering whether the Alter
and Create
should just be combined. i don't see any reason not to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean like the CREATE
should be part of the array itself? I think that makes sense.
@@ -68,6 +68,7 @@ func init() { | |||
allddls := append([]string{}, binlogplayer.CreateVReplicationTable()...) | |||
allddls = append(allddls, binlogplayer.AlterVReplicationTable...) | |||
allddls = append(allddls, createReshardingJournalTable, createCopyState) | |||
allddls = append(allddls, binlogplayer.AlterVReplicationTableSourceToBlob...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed once query is moved into AlterVReplicationTable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Toliver Jue <toliver@planetscale.com>
ee108bf
to
92eace9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Signed-off-by: Toliver Jue toliver@planetscale.com
Change the
source
column to have unlimited size (4gb), to allow for larger vreplication source content, such as many tables.source
column data.