Some tests had to be modified to not assume that masters without
replicas will still accept writes. Also, some tests would create tablets
as SPARE without enabling healthcheck. As a result, the tablet has no
way of knowing whether it will eventually be a replica or rdonly, and
hence can't decide whether to enable semi-sync before starting
replication.
Healthcheck is basically required now, and definitely will be once we
fully switch to vtgate discovery mode. So I've removed cases where
tablets were being started SPARE without enabling healthcheck.
This is the first pass for some subdirectories.
Recurring issues include:
1. Inconsistent quote chars. Use the same quote character as the first
use in the file (usually single-quote). Double quotes are OK if the
quoted string contains single quotes.
2. Bad indentation. Indent 2 for logic, 4 for continuations if the
previous line ends with '(', '[', or '{'. If drop does not immediately
follow the group-symbol, align with the opening group-symbol. I suggest
immediate drops, since these are stable if the content of the first
line changes, while aligning with the opening group-symbol requires
shifting the continuation lines.
3. Bad docstrings. A full docstring looks like:
"""Initial line ending with punctuation.
Optional text.
Args:
Arg1: Description.
Arg2: Description with
indented continuation.
Returns:
Return text.
Raises:
ErrorClass: Description.
"""
4. Vertical spacing. Exactly two blank lines before top-level classes
or functions. Exactly one blank line before non-top-level classes or
functions. No more than one blank line within top-level constructs.
1. make HTMLName() in go/vt/health/health.go return consistent name
2. fix test_tablet_status in vtctld_test to do a regular exprssion
search for MySQLReplicationLag status.
Now when we get errors, we keep them and list them,
instead of aborting the entire Serving Graph display.
Also changing the data structures a bit: used to have a map
of shard name -> list of tablets, and an accessor to convert
to a sorted list, now we have the list directly.
They allow the status page of vttablet to be better.
Also testing this code in vtctld_test, so we make sure the
templates work. And manual inspection works very well too.