UnixVolume has no business being loud about files that can not be found.
authorWard Vandewege <ward@curoverse.com>
Wed, 2 Jul 2014 01:12:47 +0000 (21:12 -0400)
committerWard Vandewege <ward@curoverse.com>
Wed, 2 Jul 2014 01:48:03 +0000 (21:48 -0400)
Just pass on the error to the caller and be quiet.

Back story: for every PUT, Keep checks if the block already exists.
Prior to this patch, UnixVolume would complain loudly if the block did
not already exist in the volume (i.e. the normal case for a PUT).

services/keep/src/keep/volume_unix.go

index 7b711d2eac1e7c6f5024cc49f723dc31c6c86952..aafc8debf134ec4bf8c44fbb93d2bc6313892e72 100644 (file)
@@ -111,12 +111,7 @@ func (v *UnixVolume) Put(loc string, block []byte) error {
 func (v *UnixVolume) Read(loc string) ([]byte, error) {
        blockFilename := filepath.Join(v.root, loc[0:3], loc)
        buf, err := ioutil.ReadFile(blockFilename)
-       if err != nil {
-               log.Printf("%s: reading %s: %s\n", v, blockFilename, err)
-               return nil, err
-       }
-
-       return buf, nil
+       return buf, err
 }
 
 // Write stores a block of data identified by the locator string