[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] Key identities...
From: |
Timothy Brownawell |
Subject: |
Re: [Monotone-devel] Key identities... |
Date: |
Mon, 05 Nov 2007 07:07:41 -0600 |
On Mon, 2007-11-05 at 00:33 -0800, Nathaniel Smith wrote:
> On Sun, Nov 04, 2007 at 07:55:10PM -0600, Timothy Brownawell wrote:
> > Could we also handle this by making process_data_command error() on
> > data_exists for a key item? I believe all keys are sent before any certs
> > are sent, so this should block any key collision errors from propagating
> > over netsync.
...err, except that data_exists checks by hash, not name. d'oh. But that
really only means we do the check a couple lines later.
> It already does error out if you try to put two keys with the same
> name into the same db.
database::put_key() will W() and return false. So the thing to do would
be something like this:
--- netsync.cc d577024111ef69679d929cb85b1c1e56c7504cff
+++ netsync.cc 50b0ee5fa1808bdcf31ff87cf3c5716c9d2ad009
@@ -1954,6 +1954,9 @@ session::process_data_cmd(netcmd_item_ty
% hitem % keyid % hitem % tmp);
if (app.db.put_key(keyid, pub))
written_keys.push_back(keyid);
+ else
+ error(partial_transfer,
+ (F("Received duplicate key %s") % keyid).str());
}
break;
...actually, I think I'll add a test and commit that.
> Does netsync really send keys first before certs? I don't remember
> that. (In general we don't consider it an error to have a cert
> without a key, so it might not be being handled the same way as say
> files-before-revs-before-certs.)
It queues all the keys from process_done_command when key refinement
finishes. Revs and certs are queued from the event loop anytime after
all refinements are finished.
--
Timothy
Free (experimental) public monotone hosting: http://mtn-host.prjek.net
- [Monotone-devel] Key identities..., Richard Levitte, 2007/11/04
- [Monotone-devel] Re: Key identities..., Lapo Luchini, 2007/11/04
- Re: [Monotone-devel] Key identities..., Timothy Brownawell, 2007/11/04
- Re: [Monotone-devel] Key identities..., Nathaniel Smith, 2007/11/05
- Re: [Monotone-devel] Key identities..., Jack Lloyd, 2007/11/05
- Re: [Monotone-devel] Key identities..., Chad Walstrom, 2007/11/05
- [Monotone-devel] Re: Key identities..., Graydon Hoare, 2007/11/05
- Re: [Monotone-devel] Re: Key identities..., William Uther, 2007/11/18
- Re: [Monotone-devel] Re: Key identities..., Jack Lloyd, 2007/11/18
- Re: [Monotone-devel] Re: Key identities..., William Uther, 2007/11/18
- Re: [Monotone-devel] Re: Key identities..., Stephen Leake, 2007/11/18
- Re: [Monotone-devel] Re: Key identities..., Richard Levitte, 2007/11/18