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
workflow: Add horizontal resharding workflow. #2393
Conversation
84ca0bd
to
e3f2cba
Compare
Overall, the change looks good :) I've left a couple of comments regarding style. Regarding the workflow itself: The next step is to break it into sub nodes (see my comment about children). Can you please do that? Thanks! Reviewed 6 of 6 files at r1. go/vt/vtctld/workflow.go, line 40 at r1 (raw file):
nit: Missing period. Please always use full sentences in comments. The Go comments only ask you do it for comments of declarations: https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences But I think it's useful to apply this to all comments. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 1 at r1 (raw file):
Please do not use abbreviations ("reshard"). Super short variable names make sense when the scope of a variable is very small e.g. for _, s := range shards {
// Do something with "s".
}
But for identifiers with a broader scope, abbreviations can be confusing because not everybody knows them or thinks of a different meaning.
Regarding this package in particular: I suggest to name it `resharding` because we'll probably create a workflow for the vertical split as well. (Maybe, we'll even rename it to vertical resharding or merge both workflows into one. Given that, `resharding` is the best name for this package.) go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 4 at r1 (raw file):
s/need/needs/ (third person singular) go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 4 at r1 (raw file): Note that there must be one vtworker instance per source shard.
I don't think we have to excuse ourselves :) Instead, you can just state it as an assumption. E.g. The workflow assumes that there are as many vtworker processes running and reachable via RPC as there are source shards. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 5 at r1 (raw file):
s/Input/input/ (lower case) go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 5 at r1 (raw file):
I suggest to delete this comment because it's redundant. The same information is present in the "ReshardWorkflowData" struct as well. And since this is not Python, we don't have to comment fields just to document their type. This is already done in the code :) go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 6 at r1 (raw file):
keyspace to be resharded go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 7 at r1 (raw file):
Note there can be multiple source shards. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 9 at r1 (raw file):
See comment above. There should be one vtworker per source shard. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 17 at r1 (raw file):
Within our code base, we further break down this import group. We're basically extending this rule: https://github.com/golang/go/wiki/CodeReviewComments#imports I suggest:
i.e. it should look like this: import (
"encoding/json"
"flag"
"fmt"
"strings"
"golang.org/x/net/context"
log "github.com/golang/glog"
"github.com/youtube/vitess/go/vt/automation"
"github.com/youtube/vitess/go/vt/logutil"
"github.com/youtube/vitess/go/vt/tabletmanager/tmclient"
"github.com/youtube/vitess/go/vt/topo"
"github.com/youtube/vitess/go/vt/topo/topoproto"
"github.com/youtube/vitess/go/vt/vtctl"
"github.com/youtube/vitess/go/vt/workflow"
"github.com/youtube/vitess/go/vt/wrangler"
workflowpb "github.com/youtube/vitess/go/vt/proto/workflow"
) go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 31 at r1 (raw file):
Please rename to go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 34 at r1 (raw file):
nit: missing period go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 35 at r1 (raw file):
Please name it go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 39 at r1 (raw file):
Please always write "vtworker". When you need to capitalize it, please capitalize only the first letter: Vtworker I understand that the rest of the team doesn't always follow this rule e.g. some of our docs talk about Please also omit "Server". It's okay to assume that it's always the server and not e.g. a client. Given that, I suggest to rename it to "Vtworkers". go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 42 at r1 (raw file):
nit: missing definite article: the horizontal resharding workflow nit 2: "for controlling" or "to control" go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 43 at r1 (raw file):
I recommend to name this go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 45 at r1 (raw file):
Remove this comment and instead leave a TODO in the code where you plan to add checkpointing. Alternatively, add such a general TODO at the beginning of a struct definition or the beginning of the file. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 54 at r1 (raw file):
Please name this field Within the protobuf message, which is used for the checkpoints, this data is stored in a field named "data" as well: https://github.com/youtube/vitess/blob/master/proto/workflow.proto#L46 go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 57 at r1 (raw file):
nits:
On a more general note: It's recommended to document what the function does first and then mention that it implements a particular interface. For example: // Run executes the horizontal resharding workflow and updates the UI message accordingly.
// It is part of the workflow.Workflow interface. (I understand that most of our code does not follow this guideline, but it should. If the method is trivial, it's fine to omit a comment for the method and only mention that it implements the interface.) go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 71 at r1 (raw file):
typo: drives go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 74 at r1 (raw file):
Please remove this and the next variable and inline it instead. As you noticed, in this type of workflow the keyspace is identical for the source and the destination anyway. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 76 at r1 (raw file):
Please make this a list in the same way as the destination shards. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 77 at r1 (raw file):
This variable has little value. Please inline the code instead. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 78 at r1 (raw file):
If a string has the keyspace and the shard, we sometimes call it go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 79 at r1 (raw file):
Please use a for each loop with the range command here. Note that you can also use append and that it also works with a nil slice: var destinationKeyspaceShards []string
for _, s := range hw.info.DestinationShards {
destinationKeyspaceShards = append(destinationKeyspaceShards, topoproto.KeyspaceShardString(hw.info.Keyspace, s))
} go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 83 at r1 (raw file):
"to copy the schema from the first source shard ..." go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 83 at r1 (raw file):
I forgot to mention an important detail. The workflow package supports hierarchical workflows and that is exactly what we want here. For each step (copy schema shard, clone, wait for filtered replication, diff, MST), we want a sub group and within each group we want one entry per source (or where applicable) per dest shard. On the UI side, you present this as Children of the root UI node (and then children of the children). For example, here's the schema swap code which creates a child for each shard: https://github.com/youtube/vitess/blob/master/go/vt/schemamanager/schemaswap/schema_swap.go#L422 In our case, we want nodes for the phase on the first level and a node per shard on the second level. Please change the code accordingly. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 84 at r1 (raw file):
Please use the TODO format i.e. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 85 at r1 (raw file):
optional: It's totally okay to use shorter variable names for variables with a narrow scope. E.g. here I would have been fine with go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 87 at r1 (raw file):
Please do not use the You can call go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 89 at r1 (raw file):
Please add fmt.Sprintf("Horizontal Resharding: error in CopySchemaShardFromShard from %s to %s: %v", sourceShardInfo, destShardInfo, err) go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 93 at r1 (raw file):
has finished go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 97 at r1 (raw file):
As mentioned above, please loop over the source shards here and match the n'th source shard with the n'th vtworker. We want that because we want to execute the per shard actions in parallel. To run things in parallel, please launch them as Go routines. Use a WaitGroup to wait for all Go routines and an ErrorRecorder to capture if any Go routine failed. Here's an example for that: https://github.com/youtube/vitess/blob/master/go/vt/wrangler/keyspace.go#L470 go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 101 at r1 (raw file):
Just use go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 102 at r1 (raw file):
Please add a TODO here that this must become a parameter of the workflow. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 136 at r1 (raw file):
Please use the String value of the enum types instead: e.g. topodatapb.TabletType_MASTER
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 150 at r1 (raw file):
nits:
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 163 at r1 (raw file):
nit: missing period go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 175 at r1 (raw file):
Please remove this comment because it won't be visible to users and therefore won't help them to understand how they need to input the data. Instead, I recommend to update the help text on the next line: before: list of source shards of resharding In doubt, see the go/vt/vtctl/vtctl.go file for inspirations from existing help texts :) go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 176 at r1 (raw file):
See also comment below. Please omit the test/workflow_horizontal_resharding.py, line 27 at r1 (raw file):
I think it's better to swap "Horizontal Resharding" and "Workflow" i.e. "TestHorizontalReshardingWorkflow". The same applies to the filename. test/workflow_horizontal_resharding.py, line 30 at r1 (raw file):
We're reusing worker.py because it contains the code to set up the environment and verify the data. The resharding itself is executed by your workflow and we're not reusing worker.py for that. test/workflow_horizontal_resharding.py, line 45 at r1 (raw file):
Please do not keep debug code. This can probably be removed? If not, uncomment utils.pause on the next line please. test/workflow_horizontal_resharding.py, line 63 at r1 (raw file):
Do not store return variable since you're not using it. test/workflow_horizontal_resharding.py, line 95 at r1 (raw file):
nit: The wrapping here looks to extreme. Can you please try to fit it into as little lines as possible? web/vtctld2/package.json, line 55 at r1 (raw file):
Please revert this change. As far as I remember, the bug which we encountered with the typescript version was fixed by changing the version in a different file (which is not under our source control). web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 32 at r1 (raw file):
Please use (I know I've called it web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 35 at r1 (raw file):
destination_shards web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 38 at r1 (raw file):
vtworker_addresses web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 46 at r1 (raw file):
Please remove this comment. web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 103 at r1 (raw file):
Please rename the prefix of these flags to web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 126 at r1 (raw file):
s/VTWorker Server/vtworker addresses/ s/server address of vtworker./List of vtworker addresses./ Comments from Reviewable |
go/vt/vtctld/workflow.go, line 40 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 1 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
|
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 4 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 84 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 4 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 5 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 5 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 6 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 7 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 9 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
should I make it into string[], like source shards? Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 17 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 31 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 34 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 35 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 42 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 43 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 45 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 54 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
Review status: 4 of 6 files reviewed at latest revision, 51 unresolved discussions. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 9 at r1 (raw file): Previously, wangyipei01-bot wrote…
Yes, please. Comments from Reviewable |
test/workflow_horizontal_resharding.py, line 27 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/workflow_horizontal_resharding.py, line 30 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/workflow_horizontal_resharding.py, line 45 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/wrangler/schema.go, line 29 at r5 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/wrangler/shard.go, line 356 at r6 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/wrangler/shard.go, line 356 at r6 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 126 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 30 at r6 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 105 at r6 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 87 at r1 (raw file): Previously, wangyipei01-bot wrote…
Done. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 6 at r5 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 35 at r5 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 70 at r5 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 40 at r5 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
no unused code now. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 85 at r6 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 49 at r6 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 42 at r6 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 43 at r5 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 47 at r5 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
test/horizontal_resharding_workflow.py, line 75 at r5 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
I've reviewed everything now. The unit test looks great. That's the way to go :) My other comments are mostly style comments. Let's wrap these up and then move on with the implementation of the state based execution :) Reviewed 2 of 5 files at r6, 1 of 1 files at r7. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 49 at r7 (raw file):
nit: missing period. The comment as it is does not provide a lot of information. I suggest to remove it or add a longer comment. In this case I suggest to remove it. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 52 at r7 (raw file):
Same comment as above. Please remove this comment. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 66 at r7 (raw file):
I suggest to structure the list of fields differently:
go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 82 at r7 (raw file):
This should be a per phase struct and not per shard. But let's keep this as is for now because you're likely going to change this later. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 92 at r7 (raw file):
This should be an anonymous field (without a name). See: http://golangtutorials.blogspot.com/2011/06/anonymous-fields-in-structs-like-object.html This way you can reference the data fields in the code below as "hw.Keyspace" instead of "hw.data.Keyspace" i.e. you can omit "data". This makes the code more readable. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 92 at r7 (raw file):
Please move this field to the top of the struct for the same reasoning as above. This is immutable data which will be set at initialization time. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 92 at r7 (raw file): Please change this from a pointer type to a type. This is immutable data and by not using a pointer you're expressing this. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 95 at r7 (raw file):
"a per source" because it's one. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 95 at r7 (raw file):
for each source shard go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 104 at r7 (raw file):
You don't need this variable. Instead, the "range" command below will provide the index for you as well: for i, os := range overlappingShards { go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 117 at r7 (raw file):
This line must go into the "if" on the next line. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 144 at r7 (raw file):
This feels redundant because the parent node has the same name. Additionally, the If that's the case, I suggest go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 173 at r7 (raw file):
Please move this function to the top after the definition of the structs. I recommend to write the code such that somebody can read it from top to bottom. In this case "Run" would be the entry point to the code and it would then call other functions e.g. "createSubWorkflow()". go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 185 at r7 (raw file):
nit: Please write this as a proper sentence i.e. capitalize "Support" and add a period at the end. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 198 at r7 (raw file):
No need for hw.logger.Infof("Horizontal Resharding: error in CopySchemaShard: %v.", err) Also: Please always leave a space " " after the colon ":" i.e. "CopySchemaShard: %v" Please fix this throughput the file. Same applies for "progressMessage" below. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 219 at r7 (raw file):
in parallel go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 219 at r7 (raw file):
Shorter sentences are easier to read. Therefore, please replace the comma with a period and start a new sentence instead: "It fails when ..." go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 219 at r7 (raw file):
This comment is actually wrong because you're using the "AllErrorRecorder". It will return all occurred errors. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 220 at r7 (raw file):
fail (plural because of "several") go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 221 at r7 (raw file):
subWorkflow to be consistent with other names in the file. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 221 at r7 (raw file):
FYI: Instead of passing in a function type, you should define an interface with an "Execute" interface. Then each subworkflow object would implement this and you could call it. This would be a more object oriented style of programming. However, let's hold back on this since you're changing the code to the state approach anyway. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 222 at r7 (raw file):
Please use the ":=" syntax instead because that's what we're using throughout the code base as well. Additionally, please shorten the variable name because it's a short scope and the same name is already mentioned in the type. After these changes, it should look like this: ec := concurrency.AllErrorRecorder{}
wg := sync.WaitGroup{} go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 240 at r7 (raw file):
Please use go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 332 at r7 (raw file):
go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 385 at r7 (raw file):
Let's keep it simple and just name it "clone". go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 389 at r7 (raw file):
"diff" go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 393 at r7 (raw file):
"migrate" go/vt/workflow/resharding/horizontal_resharding_workflow_test.go, line 80 at r7 (raw file):
As discussed offline, please do not repeat this code in the test. Instead, I suggest to have a "Run" and a "run" function. In "Run" you can set the wrangler from the workflow library and call "run". Then in "run" you would put this code. This way, you can call "run" from your test. Comments from Reviewable |
go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 49 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 52 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 240 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
3ec5e8d
to
1cb1527
Compare
Review status: all files reviewed at latest revision, 97 unresolved discussions. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 66 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 82 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Leave it later. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 92 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 92 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 92 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 95 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 95 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 104 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 117 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 144 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 173 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 185 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 198 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 219 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 219 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 219 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. (removed) go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 220 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 221 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 221 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Leave it later. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 222 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 332 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 385 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 389 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 393 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/resharding/horizontal_resharding_workflow_test.go, line 80 at r7 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Leave it later after refactoring the code. go/vt/wrangler/keyspace.go, line 29 at r5 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. go/vt/workflow/horizontalreshard/horizontal_resharding_workflow.go, line 83 at r1 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
6d142a8
to
13aebda
Compare
Very good! Please address my last three comments and then you're good to merge it! :) Reviewed 12 of 12 files at r8. go/vt/vtctl/vtctl.go, line 1388 at r8 (raw file):
Please simplify this: return wr.WaitForFilteredReplication(ctx, keyspace, shard, *maxDelay) go/vt/workflow/resharding/horizontal_resharding_workflow.go, line 156 at r8 (raw file):
Please write "shard" (all lower case) to be consistent with the other path names ("copy_schema", "clone", "diff", "migrate"). web/vtctld2/src/app/shared/flags/workflow.flags.ts, line 105 at r8 (raw file):
vtworkers As far as I can tell all flags are lowercase. Let's keep it this way. Comments from Reviewable |
It supports creating workflow to reshard multiple source shards. It will show a phase-based tree-structure UI. Unit Test is included for testing the happy path.
13aebda
to
f90f015
Compare
This is a beta version implementation, which simply supports creating the horizontal workflow through UI and updating progress of each step.
In the end-to-end test (test/workflow_horizontal_resharding.py), only happy path is tested. To simplify the test, rather than fetching information from front-end and checking explicitly, I manually interacting with the UI after setting up the environments.
Unit test will be added later.
Possible Optimizations (wait for feedback from reviewers, the listed
points might be useless):
list
restart the workflow
This change is