I fixed this by changing the JSON marshaller of the vtctl commands: For
protobuf messages we now use the "jsonpb" package which supports
emitting fields with zero values.
We already used this approach in the vtctld API endpoints. I've moved
the code to the "vtctl" package to make it more generic.
A drawback of this approach is that it doesn't cope well with our *Info
objects e.g. ShardInfo because the type switch recognizes them as
proto.Message and they have unexported fields which let jsonpb panic. To
work-around this, I've changed the vtctl code to marshal only the
embedded protobuf message and not the full *Info object anymore.
User can control through UI for running a canary task,
then running the remaining tasks. Create unit tests
and manually test the UI in e2e test environment.
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.
1. Improving tablet sort in dashboard.
When fetching tablet list, we sort by type as we add tablets.
Using sub-ordering for sort by type and sort by cell, to have a
deterministic order within groups.
2. Fixing initial table display in dashboard.
Only display the 'There are no tablets in this shard.' message when we
actually got a result with no tablets.
3. Fixing shard view columns width.
4. No more selection in shards view.
5. Different menus for master vs slaves in shard view.
6. Adding a refresh button to 3 dashboard views.
7. Using a single dialog for all workflows.
That way it's not linked to a single workflow component, but instead to
the window. Which as a side effect fixes the bug where opening the
dialog only greys out half of the window.
8. Moving keyspace / shard creation.
From the floating '+' button that doesn't float to a menu.
9. Using plus icon for new workflow.
Removing plus icon, as it doesn't float.
Only showing + in workflows if master.
The main goal of this change is to make not started and finished workflows
visible in the UI. Without this it was possible to create a workflow with
-skip_start option, and then it won't be visible in the UI thus not giving any
ability to actually start it. Also once workflow finishes it was disappearing
from the UI thus not giving any ability to see how it finished and whether it
existed at all or not. Besides this UI problem also workflows were never deleted
from the topo server and were accumulating indefinitely. This change makes
everything from topo server visible in the UI thus giving ability for the user
to delete already finished workflows.
This UI improvement allows the validator workflow to become less awkward and
actually finish once all fixers are done working. I'm modifying the validator
workflow to do that here as well.
- adding a flag to not display CRUD topo menus.
So that vtctld can be less dangerous in established production
environments.
- Make set RO / RW behind the replication flag.
Also add better messages, and add the ignore regexp flag.
- Tablet type changes in shard display.
Now they are sorted with master first, then replica, then rdonly, then
everything else.
Also display master in bold, replica/rdonly in italic, rest normal.
1. The schema page is now more resilient to missing data in responses.
2. The topology browser doesn't add extra '/' in topodata URLs, so we
don't do a useless roundtrip with a redirect.
3. Adding a button in UI to switch from old to new and new to old UI.
So we can enable / disable UI features.
Using it for top-level Status and Workflows links, as well as reparent
menu items.
Also re-organized the menus for shard / tablets.
- Make the first value of enums (the one that is equal to 0) to be the unknown
one, so that it was considered a programming error.
- Remove "omitempty" tag from fields where change from some value to empty value
must be passed in an update to the web UI.
- Add "omitempty" to Children because that's an important special use case.
- Modify javascript to assume that name, state, style and message of an action
is always there.
- Modify javascript to work when 'children' value was not received.
It looks like something has changed recently and now when WorkflowManager
encodes Node into json it behaves similar to proto3: when 'state' and 'style'
in an action have enum value equal to 0, it's getting omitted from the resulting
json. That caused the javascript code to skip adding the Action object to the
Node. I'm fixing the javascript to account for that and consider missing 'state'
and 'style' as being equal to 0.
This makes a minimal wiring of schema swap process into the workflow framework,
just enough to execute it and to see in the UI when it's in progress. Deeper
integration to display all the steps being done during the schema swap will be
done later.
This also fixes a few nil pointer dereference bugs discovered during testing of
the process. With those bugs fixed the rest of the code works as is.