Skip to content
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

Merged
merged 2 commits into from
Aug 27, 2020

Conversation

teejae
Copy link
Contributor

@teejae teejae commented Jul 8, 2020

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.

  • Should cause no issues with current code.
  • Ideally has no performance impact for same-size source column data.

@teejae teejae requested a review from sougou as a code owner July 8, 2020 06:05
sougou
sougou previously requested changes Jul 8, 2020
Copy link
Contributor

@sougou sougou left a 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.

@teejae
Copy link
Contributor Author

teejae commented Jul 9, 2020

@sougou ok, do we have some consolidated idea of what a redesign of this table might look like?

@sougou
Copy link
Contributor

sougou commented Jul 9, 2020

@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.

@sougou
Copy link
Contributor

sougou commented Aug 2, 2020

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.

@teejae
Copy link
Contributor Author

teejae commented Aug 25, 2020

@sougou
If we go with the ALTER statement strategy, how often would we check? we shouldn't be doing this on every write of the table right?

@teejae teejae force-pushed the tj-vrep-source-blob branch from 8acecd2 to 5515a02 Compare August 26, 2020 05:55
Signed-off-by: Toliver Jue <toliver@planetscale.com>
@teejae teejae force-pushed the tj-vrep-source-blob branch from 5515a02 to 0717e81 Compare August 26, 2020 10:11
@teejae teejae requested a review from sougou August 26, 2020 10:38
@teejae
Copy link
Contributor Author

teejae commented Aug 26, 2020

@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",
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

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.

Copy link
Contributor

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...)
Copy link
Contributor

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

Copy link
Contributor Author

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>
@teejae teejae requested a review from shlomi-noach August 26, 2020 10:58
@teejae teejae force-pushed the tj-vrep-source-blob branch from ee108bf to 92eace9 Compare August 26, 2020 12:00
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sougou sougou merged commit f388025 into vitessio:master Aug 27, 2020
@deepthi deepthi added this to the v8.0 milestone Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants