[chord] Problem with dhashcli

Emil Sit sit at MIT.EDU
Sun Feb 3 20:47:15 EST 2008


Czesc Katarzyna,

On Wed, 30 January 2008 at 02:07 (+0100), Katarzyna Stefanowicz wrote:
> I've got to insert some blocks into dhash. Because my code runs inside
> of lsd I'm not using dhashclient class (and unix pipe) but dhashcli
> class. Everything works well when I'm inserting block with
> ctype==DHASH_CONTENTHASH. But when I changed ctype to DHASH_NOAUTH it
> stopped working.

The dhashclient class does do some re-arranging of the data
in the case of NOAUTH blocks before passing it off to the
gateway/dhashcli for storage.  In particular, NOAUTH stores
on the server side are expected to be vec<str>s so that it
can handle updates.  To make this happen, dhblock_noauth::marshal_block
formats the incoming str as a vec<str>.  (Because dhashcli is used by
more than just dhashclient, it can't know whether or not to marshal
any argument that it receives.

You should be able to mirror the code in dhashclient::insert
below in your publish code to deal with this. 

Something like (untested)...

void
incognito_impl::publish (const incognito_store_arg &req)
{
    str data = str (req.data.base (), req.data.size ());
    if (req.key_type == DHASH_NOAUTH)
      data = dhblock_noauth::marshal_block (data);
    ref<dhash_block> = New refcounted<dhash_block> (data, req.key_type);

    ...

Does that help?

-- 
Emil Sit / MIT CSAIL PDOS / http://pdos.csail.mit.edu/chord/  



More information about the chord mailing list