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: 1/2
Change-Id: Ide99a45b868093d9bfdf53e4d7cdc4f86a43941e
4 files changed