[Unison-hackers] a common patch set - first attempt [repost]

Trevor Jim trevor at research.att.com
Wed Jun 15 14:51:44 EDT 2005


> 1) Adopt a convention that, whenever anyone makes a change to a 
> marshalled data structure, they bump the major version number, and 
> make Unison's startup test just the major version number and ignore 
> the minor version number.  This seems viable (especially since we have 
> multiple people looking at commit messages and if one person forgets, 
> someone else is likely to notice), and it has the great advantage of 
> being simple.

Like Jerome, I worry about your (1), I think it would be
easy for a developer to miss the need for this.

Maybe here is a slight improvement:

Let's have a "protocol number" and require client
and server to have the same protocol number.  All
sessions start by checking this, using a sequence
of messages that does not change even if the
protocol number changes.

Require all protocol messages to be registered before
a session begins, using the "register" functions of
remote.ml.  (Already true I believe.)  The register
functions calculate a cumulative protocol number,
a fingerprint of their arguments.  I don't know how
to make this a true fingerprint given ocaml's
current public interfaces, but for the moment let
the fingerprint be MD5 hash of all of the protocol
message names, plus a "datatypes number" that we
bump whenever we change something that is outside
of that (this part being essentially what Benli
suggests).

This isn't perfect but it buys us some automatic
protection.  (And maybe Jerome or another ocaml
insider can tell us how to get a better fingerprint.)

The protocol number could be reflected in the version
number, or not.  I actually prefer not.  I can
conceive of a new major version that does not change
the protocol; if we are trying to make different
versions interoperable I don't know why we'd do that.
Also, we are bumping the version number manually,
and I think we all agree that a fully automated
system would be best in the end; why require another
manual step to get right.

-Trevor



More information about the Unison-hackers mailing list