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.
* 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.
In the process:
- fixing binlog replay starting from a timestamp: we just cannot skip
the events at a lower level, as the binlogs may contain format event,
binlog GTID set events, and so on. We need to parse them all.
- adding support for MySQL 5.6 PREVIOUS_GTIDS_EVENT event. It contains a
SIDBlock, adding parsing for that (we already had code to generate it,
as it's used to start replication from a GTIDSet).
- Some code in vtmysql_internals.h was incorrectly compiling for MySQL
5.6 and higher, when it should have been 5.5.
We used to close the connection and hope it would interrupt the
streaming RPC. Some RPC libraries don't interrupt on-going connections,
but instead wait for them to finish. So now we first stop the streaming
connection (by setting a flag, and forcing an event), and then close the
connection.