-
Notifications
You must be signed in to change notification settings - Fork 670
build forward and backward compatibility into the protocol #871
Comments
Here's one way to do this... The basic premise is that a particular version of weave has perfect knowledge of all the previously released versions and may contain special code to speak some such older versions. Peers could announce to each other what protocol versions they support, as part of the initial handshake. They would then pick the highest version supported by both, and communicate using that. If no such version can be found then the connection is closed and a suitable error logged, similar to what happens now when the protocol versions do not match. |
I would normally just have a bracket [oldest supported version, newest supported version], and you have to support everything in-between. Yes, a set is more general, but maybe YAGNI. |
Good point re oldest+newest. Perhaps we could even just stick to transmitting the newest version, as we do now, and leaving it up to the peer with the higher version to close the connection if the other peer's version is too old. I can think of two downsides:
|
We now first exchange a very minimal header, consisting of just the name of the protocol ("weave") and the min and max version (encoded as a byte each) we support. This leaves all other details of the protocol, including the contents of of the handshake, open. Peers agree to communicate using the maximum mutually supported version. We record this in the LocalConnection, though atm nothing is making use of that information. We set a shorter than normal deadline (10s instead of 60s) for the header exchange, so we detect version mismatches, garbage, or non-responsive remotes quickly. We reset the protocol version to '1' since this is a fresh start; old weaves will not be able to parse the header. Closes weaveworks#871.
ATM weave peers must all be running the same version of the protocol; both sides of a new connection will shut it down when detecting that the protocol version of the remote peer differs from their own.
This makes upgrading weave when the protocol version has changed a major event.
We should build some mechanisms into the protocol for handling forward and backward compatibility.
Extracted from #403 (comment)
The text was updated successfully, but these errors were encountered: