syncbase blobs: Fix bug in leaf handoff of blobs, and add test for same.
        Add DevModeGetBlobShares() to the Service interface.  This allows tests
        to check the blob ownership shares in the syncbases instances they
	Add checking of blob ownership shares to TestV23ServerBlobFetch().

        Add new test TestV23LeafBlobFetch() that checks that a blob (and one of
        its shares) is transferred off a leaf as soon as the leaf gets a chance
        to ask another syncbase to take it.

        The new routine getTestStructAndBlobFromRow() is a common piece from
        various other routines.  I pulled it out because I was adding the
        getBlobOwnershipShares() call.

        The checkShares() call uses DevModeGetBlobShares() to check the
        ownership shares of the various blobs and syncbases.
        Change RequestTakeBlob() to RequestTakeBlobs() (plural) to allow a
        single call to request that the recipient take ownership of several

	Add GetBlobShares(), which is used by DevModeGetBlobShares().
        Add DevModeGetBlobShares() which allows the client to interrogate the
        blob ownership sjhare state on the server.  It requires "-dev" mode,
        and admin access.
	Implement RequestTakeBlobs().  The previous call RequestTakeBlob()
	merely returned a "not implemented" error.
        The new implementation iterates over all the blobs for which the
        requester is asking for shares to be taken, and queues the blob to be
        fetched iff the current server doesn't have any shares already.

        Add syncService.GetBlobShares(), which is called by
        DevModeGetBlobShares() to allow etsts to check the ownership share
        In syncService.getDeltas(), after updating the syncgroup priorities
        after the GetDeltas() call, look for blob shares to handoff, and if
        there are any, call RequestTakeBlobs() to tell the responder to
	fetch the relevant blobs.
	Add an "expiry" time to blob fetch requests.
        This is useful both in the server (where it should probably stop
        fetching eventually if the blobref goes away), and for fetching for
        leaves (where it should stop fetching if the syncbase is no longer in
        communication with the leaf).

	Modify StartFetchingBlob() to take an expiry time for the fetch request,
	and to set in in the blobFetchState.

        Add SyncServiceBlobFetcher() to allow the rest of the syncService code
        to get its hands on the blobFetcher created by the ServerBlobFetcher()

        Modify ServerBlobFetcher() to advertise the blobFetcher in the
        syncService struct.
	Accommodate new parameter of StartFetchingBlob().
	Advertise the blobFetcher in the syncService struct.
	Bug fix in sgPriorityLowerThan().  In a previous change,
	I changed the order of the BlobDevType{Leaf,Normal,Server}
	constants so that "normal" would be the default (zero) value.
	At the time I said, that nothing depends on the order, but I was wrong.
	This routine did.

        Modify updateAllSyncgroupPriorities() to return, as a side-effect, the
        ownership shares that a leaf should hand off to a non-leaf after a
        GetDeltas() call.

MultiPart: 2/2
Change-Id: If38e9f5bd124af057035b01a060d7d3be4f44901
9 files changed
tree: 773958ef77dce7376216aa0be328033ee18047c7
  1. cmd/
  2. examples/
  3. internal/
  4. lib/
  5. runtime/
  6. services/
  7. test/
  8. .gitignore
  12. envvar.go
  13. envvar_test.go


This repository contains a reference implementation of the Vanadium APIs.

Unlike the APIs in, which promises to provide backward compatibility this repository makes no such promises.