Allow specifying the hashing method for CreateLookupVindex#14157
Allow specifying the hashing method for CreateLookupVindex#14157dbussink wants to merge 1 commit intovitessio:mainfrom
Conversation
This change allows specifying the vschema fragment to override the hashing used for the backup table for the lookup vindex. This is something someone can manually already modify / set up in the vschema, but CreateLookupVindex does not support this properly. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
There was a problem hiding this comment.
Thanks, @dbussink ! Overall this LGTM and makes sense. Just a couple of minor things.
I'm working on the vtctldclient implementation here (was about to mark it as ready for review): #14086
I can add the same support there.
We should update the e2e test to include the lookup vindex's target table primary vindex definition too. I can do that in my PR.
|
|
||
| // Update targetVSchema | ||
| var targetTable *vschemapb.Table | ||
| targetTable := specs.Tables[targetTableName].CloneVT() |
There was a problem hiding this comment.
Wanted to make sure it doesn’t end up modifying the original here from the user input.
There was a problem hiding this comment.
We don't change it though. And I feel like if we do change it, that might be what we want? I don't know why we'd want them to differ off the top of my head. I was gong to skip this part in the vtctldclient implementation.
| // Loop executes once or twice | ||
| for k, ti := range specs.Tables { | ||
| if len(ti.ColumnVindexes) != 1 { | ||
| return nil, nil, nil, fmt.Errorf("exactly one ColumnVindex must be specified for the table: %v", specs.Tables) |
There was a problem hiding this comment.
We should now instead specify the actual table name here rather than the spec.
There was a problem hiding this comment.
You mean in the error message?
| vindexCols = ti.ColumnVindexes[0].Columns | ||
| } else { | ||
| if ti.ColumnVindexes[0].Column == "" { | ||
| return nil, nil, nil, fmt.Errorf("at least one column must be specified in ColumnVindexes: %v", sourceTable.ColumnVindexes) |
There was a problem hiding this comment.
This should be using ti.ColumnVindexes in the error.
|
I have added two labels
|
|
After talking with Harshit, I think I'm going to make the default for Since we're going to be updating the summary in this PR anyway, should we change the vtctlclient default here as well @harshit-gangal ? |
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
|
This PR was closed because it has been stale for 7 days with no activity. |
This change allows specifying the vschema fragment to override the hashing used for the backup table for the lookup vindex. This is something someone can manually already modify / set up in the vschema, but CreateLookupVindex does not support this properly.
Related Issue(s)
Fixes #14155
Checklist