Idea #7710
closed[SDKs] GoSDK KeepClient works with all service types, applying rules for the proxy type
Description
The Keep client in the Go SDK should connect to services of any type. For any type that isn't disk, it should follow the rules that we currently follow when connecting to proxies:
- Only allow one writer thread at a time.
- Use "proxy" timeouts.
- Respect the replication headers in the response.
- Create some keep_services with service_type="fancynewblobstore"
- Ensure those keep services are used when reading and writing
- Ensure that the client only sends one write when the service reports that it wrote enough replicas
Write the above test cases to ensure proper behavior for non-disk, non-proxy services, then make whatever code changes are necessary to make them pass. Right now, we believe no code changes are necessary, but the tests will verify that.
Updated by Tom Clegg about 9 years ago
Looks like the "unknown service type" handling is already correct.
if service.ReadOnly == false { writableLocalRoots[service.Uuid] = url if service.SvcType != "disk" { this.replicasPerService = 0 } }So, maybe we just need
- use proxy timeouts if any non-disk (instead of "if any proxy")
- tests
Updated by Radhika Chippada about 9 years ago
- Status changed from New to In Progress
- Assigned To set to Radhika Chippada
- Target version changed from Arvados Future Sprints to 2015-12-02 sprint
Updated by Tom Clegg about 9 years ago
$ git grep Using_proxy sdk/go/keepclient/discover.go: this.Using_proxy = false sdk/go/keepclient/discover.go: this.Using_proxy = true sdk/go/keepclient/keepclient.go: Using_proxy bool sdk/go/keepclient/keepclient.go: Using_proxy: false, sdk/go/keepclient/keepclient_test.go: kc.Using_proxy = true sdk/go/keepclient/keepclient_test.go: kc.Using_proxy = true services/datamanager/datamanager_test.go: Using_proxy: true, services/keepproxy/keepproxy_test.go: kc.Using_proxy = true services/keepstore/keepstore.go: Using_proxy: true, services/keepstore/pull_worker_integration_test.go: Using_proxy: true,
Not(Equals), ""
...?
c.Assert(kc.LocalRoots()[blobKeepService["uuid"].(string)], NotNil)
Pushed 5f7c3a3 to get some test coverage (admittedly not much) on keep_services#accessible.
Updated by Tom Clegg about 9 years ago
- Make the "disk" string configurable with a command line argument (
-service-type=X
, default "disk") - If other service types are encountered, log that they're being ignored, but then continue.
- Error out only if there are no services with the configured type.
Updated by Radhika Chippada about 9 years ago
We still seem to set Using_proxy to true and false in various places, but we never read it, so presumably we can just delete all references to it?
Removed all these references. All the tests seem to be passing (still running tests). However, do we need to set ArvadosClient.External in any of these places?
These assertions are not effective -- the nil value of a string is "", not nil
Thanks for noticing. Updated these.
Related: datamanager errors out if it sees a service_type other than "disk".
Added an extra service-type arg with default value "disk" in keep.go and used it instead.
Updated by Tom Clegg about 9 years ago
-service-type string Supported keepservice type. Default is disk. (default "disk")
- "Supported" is a bit mysterious too; suggest "Operate only on keep_services with the specified service_type, ignoring all others."
The words "indexable" and "supported" seem to be used interchangeably in the names "indexableKeepServers" and "supportedServiceType". Perhaps they could just be called "selectedKeepServers" and "selectedServiceType", or even just "keepServers" and "serviceType"?
Likewise, the word "unsupported" in "Ignore unsupported service type: %v" seems weird (I'd expect "unsupported" to mean "datamanager can't handle this service_type"). How about:"Skipping keep_service %q because its service_type %q does not match -service-type=%q"
// Ignore any services that are of type other than the "supportedServiceType". // If no services of the "supportedServiceType" are found, raise an error.
Updated by Tom Clegg about 9 years ago
Noting we don't have one of the tests requested by the issue:
Ensure that the client only sends one write when the service reports that it wrote enough replicas
(This shouldn't hold up the current branch, but still seems like a good idea. Perhaps we already have a test like this attached to the "max replicas expected per PUT" code?)
Updated by Brett Smith about 9 years ago
- Target version changed from 2015-12-02 sprint to 2015-12-16 sprint
Updated by Radhika Chippada about 9 years ago
- Made all those text updates for -service-type
- Test "Ensure that the client only sends one write when the service reports that it wrote enough replicas". TestMakeKeepClientWithNonDiskTypeService asserts that kc.replicasPerService is set correctly, though there is room for more tests.
Updated by Tom Clegg about 9 years ago
LGTM @ 311993c
There aren't any merge conflicts here, so doing "git rebase master" on this branch before merging it will eliminate some "merge master" noise in the git history.
Updated by Radhika Chippada about 9 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset arvados|commit:7ed2f9d875d69b1494372c0cb790b18187dbacf2.
Updated by Radhika Chippada about 9 years ago
- Target version changed from 2015-12-16 sprint to 2015-12-02 sprint