KeyRange is `nil` for all non-range-based shards, so this was removing
all non-range-based shards from serving, instead of just the one shard.
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
Issue #3158
The current value of 0 is definitely incorrect because vitess
treats table names as case-sensitive. It's better we don't set
this variable at all. Let the users decide what it should be.
Please refer to #2694 and #2670 for motivation and reasoning for
this change.
I've tried to follow best practice in inserting the copyright
headers. In other open source projects, not all files carry
the notice. For example documentation doesn't. I've followed
similar ground rules.
I did not change the php because there is a separate LICENSE
file there by Pixel Federation. We'll first need to notify
them our intent before changing anything there.
As for the presubmit check, it's going to be non-trivial
because of the number of exceptions, like file types,
directories and generated code. So, it will have to be
a separate project.
If we can't find a ShardReplication object, fallback to reading all the
tablets in a cell (canonical tablet records) to find potential matches.
Also adding a unit test for that logic.
And adding a new 'even_if_serving' flag to DeleteShard. That way we
won't delete a serving shard by accident.
* replication_reporter: Repair replication even if slave not configured.
It will still only attempt the repair if the global shard record has a
MasterAlias specified.
* tabletmanager: Initializing as master implies replication is allowed.
If the "do not replicate" flag was previously set, initializing a tablet
as master should clear this flag.
* Don't initialize tablets as master in tests.
Initializing a tablet as type master also sets the global shard record's
MasterAlias field. Now that we auto-configure slaves any time this field
is set, it changes the expected serving state for replicas in these
tests.
Rather than just change the expected state in the tests, I updated the
tests to use our new recommended initialization flow: initialize
everything as type replica, and then pick any one of them to be master.
That way you can control the moment at which all slaves first get
configured, when you run InitShardMaster.
Make sure they use healthcheck, and start vtgate after tablets are
ready. Otherwise, you have to wait for the 1min refresh before vtgate
notices the new tablets.
This cleans up global and cell-local topology entries for a keyspace.
It only works if there are no shards left in the keyspace.
Similarly, DeleteShard only works if there are no tablets left in
the shard.
There's no need to assert that stderr is empty. The run_vtctl()
function will raise a TestError if the command returns an error code.
This check was making the test flaky because sometimes the spawned
process would emit an incidental log message despite succeeding.
The values within each row of a QueryResult were being JSON-encoded as
base64 byte arrays for every type. This JSON encoding was only being
used for tests, until the recent addition of vtctl commands that display
JSON-encoded QueryResults.
Now that we are displaying these to humans, we should display the
results as strings instead of as byte arrays.
Make min rdonly instances configurable for vtworker tasks
Remove unnecessary tablets wherever possible
Use lower buffer pool size in MySQL to save memory
Track performance using New Relic