20318: Route (*KeepClient)Get() through disk cache layer.
authorTom Clegg <tom@curii.com>
Thu, 11 Jan 2024 17:01:11 +0000 (12:01 -0500)
committerTom Clegg <tom@curii.com>
Thu, 11 Jan 2024 20:13:28 +0000 (15:13 -0500)
commit2d046e6afeb13988d1438a05301d60a5d399a371
tree96a3bb1a745e64a6cc81d16eb0ec550184814dd9
parent3583e494ed815632bbaa2582fd0a49110a21123b
20318: Route (*KeepClient)Get() through disk cache layer.

The updated implementation maintains the existing calling signature
but has some semantic differences:

The block size returned by Get is now -1 if the block size is not
indicated by the supplied locator. All locators generated by Arvados
include sizes, and Get() doesn't work on bare hashes because they have
no permission signature, so in practice this only comes up for test
cases and keepstore's pull worker.

The url returned by Get is now "" because
* in general it is not necessarily available in principle (data often
  comes from the cache instead of a backend server)
* in the cases where it is available in principle, it would be a lot
  of trouble to propagate it
* the only known reason to reveal the url is to provide detail about
  an error, in which case the error message should already include the
  relevant url.

In some cases where the upstream server responds 200 but an error is
detected early in the response content, Get() now returns the error
itself, where the old Get() implementation would have returned a
reader whose Read method returns an error.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>
sdk/go/keepclient/keepclient.go
sdk/go/keepclient/keepclient_test.go
services/keepproxy/keepproxy.go
services/keepproxy/keepproxy_test.go
services/keepstore/pull_worker.go