Smart server: where next?

Andrew Bennetts andrew at canonical.com
Thu May 3 18:42:51 BST 2007


Hi all,

I'm going to be on leave (and avoiding email!) for the next week and a bit, but
before I disappear here's my thoughts on the smart server work.

As previously posted, bzr 0.16 has lots of smart protocol infrastructure, but
only a handful of new smart commands that take advantage of it.

** We need more smart commands! **

Anyone that's interested, please dive into the code and take a look at
implementing more smart commands than just the skeleton set we have at the
moment.  The RemoteObjectHacking wiki page needs some updating, but here's the
key parts:

  - it's a stateless request-response protocol (much like HTTP).
  - bzrlib/remote.py defines the smart client side objects.  Basically, any
    method in there that calls "self._ensure_real()" (which allows the code to
    fallback to the un-smart VFS objects) is a method that needs another smart
    command added to the protocol.
  - bzrlib/smart/branch.py, .../repository.py and .../bzrdir.py implement the
    server side.  New commands are registered in bzrlib/smart/request.py.
  - bzrlib/tests/test_remote.py and .../test_smart_transport.py have the
    protocol tests (client and server), in addition to the existing tests like
    branch_implementations.

That really ought to be all you need to know to dive in, you can probably figure
out most of the other details from there by looking at existing code.  Robert
and Martin in particular are both very familiar with how it works and can answer
any questions.

So just to be really clear: please feel free to work on the smart server code!

Suggested next steps for anyone interested:

  - add more smart commands (duh).  Find a network operation that's slow because
    it does too many round trips or transfers excess amounts of data, and write
    a smart command for it.  Robert has some fancy efficient graph delta stuff
    started, but there's a fair bit of low-hanging fruit too I think.
  - better debugging.  It would be really neat to be able to do something like
    "bzr -Dsmart" and have it log to stderr all the smart requests/responses
    being made, to see what's going on.  This is probably pretty easy, and would
    be immensely helpful.
  - more testing, and performance measurements.  It's new, and could use the
    attention to make sure it's as good as I think it is!  In particular, if
    there's anywhere that e.g. bzr+ssh behaves worse than sftp (either in
    behaviour or speed), we want to know about it.  Or even anywhere that the
    documentation is lacking.

Any bugs, questions, feature requests, etc are all welcome and *very* helpful.
If you post something and it hasn't been dealt with by the time I get back, I'll
be very happy to read it and see what I can do!

I'll be back as normal on the 14th.  See you all then!

-Andrew.




More information about the bazaar mailing list