syncbase blobs: Fix bug in leaf handoff of blobs, and add test for same.

v.io/v23/services/syncbase/service.vdl
        Add DevModeGetBlobShares() to the Service interface.  This allows tests
        to check the blob ownership shares in the syncbases instances they
        start.

v.io/v23/syncbase/featuretests/blob_v23_test.go
	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.

v.io/x/ref/services/syncbase/server/interfaces/sync.vdl
        Change RequestTakeBlob() to RequestTakeBlobs() (plural) to allow a
        single call to request that the recipient take ownership of several
        blobs.

	Add GetBlobShares(), which is used by DevModeGetBlobShares().

v.io/x/ref/services/syncbase/server/service.go
        Add DevModeGetBlobShares() which allows the client to interrogate the
        blob ownership sjhare state on the server.  It requires "-dev" mode,
        and admin access.

v.io/x/ref/services/syncbase/vsync/blob.go
	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
        counts.

v.io/x/ref/services/syncbase/vsync/initiator.go
        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.

v.io/x/ref/services/syncbase/vsync/server_blob_fetcher.go
	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()
        thread.

        Modify ServerBlobFetcher() to advertise the blobFetcher in the
        syncService struct.

v.io/x/ref/services/syncbase/vsync/server_blob_fetcher_test.go
	Accommodate new parameter of StartFetchingBlob().

v.io/x/ref/services/syncbase/vsync/sync.go
	Advertise the blobFetcher in the syncService struct.

v.io/x/ref/services/syncbase/vsync/syncgroup.go
	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
  9. AUTHORS
  10. CONTRIBUTING.md
  11. CONTRIBUTORS
  12. LICENSE
  13. PATENTS
  14. README.md
  15. VERSION
  16. envvar.go
  17. envvar_test.go
README.md

Vanadium

This repository contains a reference implementation of the Vanadium APIs.

Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.