Global persistent requests:

We have a global upload/download queue, accessible to all clients. The
idea is that Fproxy or Frost can submit direct-to-disk downloads to the
global queue, which can then be monitored through FUQID's GUI. Fproxy
and Frost can then forget about them.

These are identified by having Global=true on the ClientGet/ClientPut.
ReturnType=direct or chunked is invalid for Global requests; they must
be ReturnType=disk or ReturnType=cached. The Global parameter will be
included in PersistentGet/PersistentPut notifications. Verbosity is
forced to maximum on Global requests. Global requests will not be
monitored automatically by the submitter; he has to WatchGlobal if he
wants to see its progress.

In order to watch the global queue, a client must send an FCP
WatchGlobal message:

WatchGlobal
Enabled=true // false means don't watch global
VerbosityMask=1
PolledVerbosityMask=1 // not sure about this, may just be the above
End

After this point, if the client does a ListPersistentRequests, requests
on the global queue will be included. And when a request on the global
queue completes, the client will be notified. The VerbosityMask
indicates what level of ongoing progress messages will be sent to the
client. The PersistentGet or PersistentPut will include the name of the
client which originally submitted the request.

On Wed, Feb 22, 2006 at 02:35:35PM +0000, Matthew Toseland wrote:
> Persistent requests:
> 
> An FCP request is made persistent by the client setting
> Persistence=reboot or Persistence=forever on the ClientGet/ClientPut.
> 
> These requests are not discarded when the FCP connection is closed, but
> will persist until complete or until the node exits (if
> Persistence=reboot). They are associated with the client by name (from
> the ClientHello).
> 
> Also, once a persistent request has completed, it persists until it is
> acknowledged by the client with a RemoveCompletedPersistentRequest, or
> until it falls off the end of the LRU (we keep the last 128 results). This
> is because of race conditions on losing FCP connections.
> 
> When a client (identified by Name) reconnects, we send it the status of
> all unacknowledged completed persistent requests i.e. all persistent
> requests which have completed but which have not yet been acknowledged.
> Hopefully this will ensure that clients remove completed requests which
> they know about.
> 
> When a client sends a ListPersistentRequests message, we send it the
> status of all persistent requests, either running or completed.
> 
> Sending the status of a completed persistent request *includes the data*
> if it was ReturnType=direct.
> 
> Persistent requests may include an additional field on the ClientGet,
> ClientToken. This is a string which is returned in PersistentGet's,
> which are sent as the first part of the status update.
> 
> So:
> client connects:
> ClientHello
> Name=Toad
> ExpectedVersion=2
> End
> ...
> 
> client -> node:
> ClientGet
> Identifier=78171-a
> URI=KSK at gpl.txt
> ReturnType=disk
> Filename=/home/toad/gpl.txt
> Persistence=forever // retry forever
> ClientToken=the GPL // returned in the PersistentGet
> Verbosity=0 // don't send us status updates
> PolledVerbosity=1 // include SimpleProgress if we poll for status updates
> End
> 
> ...
> 
> client -> node:
> ListPersistentRequests
> End
> 
> node -> client:
> ...
> PersistentGet
> Identifier=78171-a
> URI=KSK at gpl.txt
> ReturnType=disk
> Filename=/home/toad/gpl.txt
> ClientToken=the GPL
> End
> SimpleProgress
> ...
> End
> 
> ...
> 
> node -> client:
> DataFound
> Identifier=78171-a
> Size=32701
> Metadata.ContentType=image/jpeg // this is why we don't use KSKs much!
> End
> 
> ...
> 
> client disconnects
> 
> client reconnects:
> ClientHello
> Name=Toad
> ExpectedVersion=2.0
> End
> node reply:
> NodeHello
> ...
> End
> node sends update on persistent unacked requests:
> identify the request:
> PersistentGet
> Identifier=78171-a
> URI=KSK at gpl.txt
> ReturnType=disk
> Filename=/home/toad/gpl.txt
> ClientToken=the GPL
> End
> 
> current state:
> DataFound
> Identifier=78171-a
> Size=32701
> Metadata.ContentType=image/jpeg
> End
> 
> client acknowledges the completed request:
> RemoveCompletedPersistentRequest
> Identifier=78171-a
> End
-- 
Matthew J Toseland - toad at amphibian.dyndns.org
Freenet Project Official Codemonkey - http://freenetproject.org/
ICTHUS - Nothing is impossible. Our Boss says so.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: 
<https://emu.freenetproject.org/pipermail/tech/attachments/20060222/0fea2089/attachment.pgp>

Reply via email to