monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Re: collection versus branch


From: graydon hoare
Subject: [Monotone-devel] Re: collection versus branch
Date: Mon, 05 Apr 2004 16:11:09 -0400
User-agent: Mozilla Thunderbird 0.5 (X11/20040208)

Peter Simons wrote:

Now I try to push the branch in question into the repository
but get an error:

 | $ monotone push monotone.cryp.to to.cryp.mapson
 | monotone: rebuilding merkle trees for collection to.cryp.mapson
 | monotone: [keys: 1] [mcerts: 64]
 | monotone: connecting to monotone.cryp.to
 | monotone: [bytes in: 800] [bytes out: 712]
 | monotone: warning: caught bad_decode exception processing \
 |     peer monotone.cryp.to: 'mcert \
 |     '004c3f8435e083e80c386eee97895103dde27041' does not \
 |     exist in our database'
 | monotone: processing on fd 5 (peer monotone.cryp.to) \
 |     finished, disconnecting

And monotone is right: This particular mcert does not exist,
neither in the client- nor in the server database. But what
do I do about that?

that's curious. are you sure it doesn't exist? try this:

  monotone debug 'select * from manifest_certs where hash like "004c%"'

on both the client and server. if it really doesn't exist, I don't know why netsync would have asked to transfer it. possibly it mis-hashed a value, or a slot in the merkle node got initialized wrong. you can try:

  monotone reindex to.cryp.mapson

to rebuild the fundamental cert hashes and then rebuild the merkle trees on top of them, but if that doesn't help things.. tricky. you might try running client and server with --verbose and see what the protocol is doing in a little more detail. if you want to send that, I'll take a look.

One other question: Is it possible to run a netsync server,
which serves more than one collection at a time? Or is it
possible to have several branches within one collection? I
have *lots* of separate projects (branches) in the to.cryp.*
namespace, and I don't want to start a dozen server
processes for that! Did I miss something there?

probably I was not clear enough in the docs: you can serve as many collections as you like concurrently from a single server. that's why the netsync hooks for permission checking carry a collection name. you just need to provide multiple collection names on the "seve" command line.

  monotone serve mymachine.com collection1 collection2 collection3 ...

a collection is a prefix of some branches. so a collection "com.foo" will be the union of all branches which begin with "com.foo". you can serve multiple branches by giving them a common prefix and serving that prefix as a single collection, or by serving multiple collections.

fwiw, a "collection" corresponds to a single merkle tree in the database; essentially a "synchonization index" data structure. I had to bound the set of things to put in such an index somehow, so I figured "prefixes of branch names" would feel somewhat natural. if you think this is too awkward or unintuitive, I can pick something else (1 merkle tree per branch?)

P. S.: On the "Network Service" page, the example says:

 | function get_netsync_read_permitted (collection, identity)
 |   if (identity == address@hidden) then return true end
 |   return false
 | end

But monotone doesn't accept this code, because the string is
not in quotes.

yeah, a couple people pointed this out already. fixed in my working copy. it'll be fixed in the next version of the docs.

-graydon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]