Send As SMS

Thursday, December 08, 2005

The Banana Protocol

When I worked in Berlin, I made my first ever use of CVS in a moderately sized team (twelve people) of fulltime employees. We were using it to develop a wholesale wine marketplace on an awful, and rather fragile, e-Commerce platform; such things were popular at the time. One consequence of this was a need to perform integration work and testing at each commit. Rather than implement branching and a gatekeeper, I allowed each developer to commit directly to the trunk. CVS's lack of atomic commits combined with the hour or so that it took to do a successful integration (longer for an unsuccessful one) meant that the potential for conflicting commits, and the corresponding nightmarish debugging sessions, was high.

One lunchtime I discussed this with Ryan Shelswell (friend and, at the time, colleague) and reflected on the need for some sort of physical token, possession of which should be a precondition for starting a commit. No software needed to be integrated, this was purely a human protocol, about allowing developers to avoid treading on each other's toes. I was thinking about a debugging mallet (a "hammer" made entirely of foam, about a metre long, used primary to harmlessly thump an uncooperative computer during a debugging session in order to vent frustration) because much of a commit session was spent on debugging, but Ryan told me that he had a better idea and that, indeed, he had just the thing. The next day, Ryan appeared with an inflatable B1 about 35cm tall which the team readily accepted for the purpose.

Roll forward a couple of years to working at CounterSnipe, using CVS and encountering a similar problem. So, I described the use of B1 to my colleagues and set about finding a worthy successor. Sadly I failed (we ended up using a rubber ball), but it did solve the problem that we were having with trampling on each other's updates. (We've subsequently switched to SVN which has its own set of problems but, notably, has atomic commits.) One colleague, Jon Mann, was so impressed by the approach, and the obvious absurdity of using an inflatable banana to implement it, that he wrote it up as an RFC which, with his kind permission, I now present for your enjoyment.

Banana Working Group J. Mann
Request for Comments: 9999 Countersnipe
Category: Informational 1st April 2004


The Banana Protocol


Status of this Memo

This memo provides information for the Internet community.
This memo does not specify an Internet standard of any kind.
Distribution of this memo is unlimited.


Abstract

CVS fails to provide atomic transaction guarantees. This can lead
to an unexpected state within the repository. We define a
protocol to ensure that any one commit is fully atomic.


Terminology

The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD,
SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in
this document, are to be interpreted as described in RFC 2119.


Introduction

The Concurrent Versions System (CVS) is a popular multi user
network transparent version control system.

A "commit" is a CVS transaction that updates the repositories
codebase.


Motivation

"CVS failure to provide atomic transaction guarantees is widely
considered a bug." [1]


The Banana

A single Banana exists for each repository implementing the protocol.

The Banana is a physical entity choosen by the administrator of the
CVS repository.

The Banana represents a token that authorises the holder to action a
commit on the associated repository.

A holding location is choosen to locate the Banana when not held by
a CVS user. This location is choosen by the CVS administrator.

A user of the repository SHALL only commit if they have possession of
the Banana.


Exchange

A CVS user may obtain the Banana via any method they deem necessary.

Quake duels, deception or mindless violence are all acceptable methods.


New User

When a user is added to a repository they are instructed to adhere to
the Banana protocol.

This is the responsibility of the CVS administrator and occurs when
the login for the new user is created.

Ignorance is no excuse.


Lost Banana

This situation occurs when no user claims to hold the Banana and the
Banana is not at its holding location.

The Banana is considered "Missing In Action".

The administrator has the responsibility of replacing the Banana.


Virtual Banana

A situation may occur when a remote user needs to make a commit, but
cannot obtain physical access to the Banana. For example they maybe
working remotely.

In these cases the "Virtual Banana Clause" is invoked.

The user arranges to place the physical Banana in escrow via
another CVS user. They MAY then commit until they authorise the
Bananas release.


Credits

http://www.cvshome.org

The folks who developed CVS for an otherwise excellent product.


References

[1] http://cvsbook.red-bean.com/cvsbook.html#My_commits_seem_to_happen_in_pieces_instead_of_atomically
[2] http://www.cvshome.org/docs/manual/cvs-1.11.6/cvs_10.html#SEC88


Security Considerations

Security issues are not discussed in this memo.


Author's Address

J. Mann

Full Copyright Statement

Copyright Countersnipe (2002). All Rights Reserved.

This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction
of any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.

However, this document itself may not be modified in any way, such
as by removing the copyright notice or references to Countersnipe
or other Internet organizations, except as needed for the purpose
of developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be followed,
or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be
revoked by Countersnipe or its successors or assigns.

This document and the information contained herein is provided on
an "AS IS" basis and Countersnipe DISCLAIMS ALL WARRANTIES, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE
OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.