13647: Update config keywords in docs, comments, and error messages.
authorTom Clegg <tclegg@veritasgenetics.com>
Tue, 17 Sep 2019 17:25:45 +0000 (13:25 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Tue, 17 Sep 2019 18:19:15 +0000 (14:19 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

doc/install/install-keepstore.html.textile.liquid
services/keepstore/azure_blob_volume.go
services/keepstore/command.go
services/keepstore/handler_test.go
services/keepstore/s3_volume.go
services/keepstore/s3_volume_test.go
services/keepstore/unix_volume.go
services/keepstore/volume.go
services/keepstore/volume_generic_test.go

index 157ac589bdb37807214919f50047d812b3274744..a16de51627f72241b1200875ebdf1dfc0a2eec2e 100644 (file)
@@ -83,11 +83,11 @@ h3. Notes on storage management
 
 On its own, a keepstore server never deletes data.  The "keep-balance":install-keep-balance.html service determines which blocks are candidates for deletion and instructs the keepstore to move those blocks to the trash.
 
-When a block is newly written, it is protected from deletion for the duration in @BlobSignatureTTL@.  During this time, it cannot be trashed.
+When a block is newly written, it is protected from deletion for the duration in @BlobSigningTTL@.  During this time, it cannot be trashed or deleted.
 
-If keep-balance instructs keepstore to trash a block which is older than @BlobSignatureTTL@, and @EnableDelete@ is true, the block will be moved to "trash".  A block which is in the trash is no longer accessible by read requests, but has not yet been permanently deleted.  Blocks which are in the trash may be recovered using the "untrash" API endpoint.  Blocks are permanently deleted after they have been in the trash for the duration in @TrashLifetime@.
+If keep-balance instructs keepstore to trash a block which is older than @BlobSigningTTL@, and @BlobTrashLifetime@ is non-zero, the block will be moved to "trash".  A block which is in the trash is no longer accessible by read requests, but has not yet been permanently deleted.  Blocks which are in the trash may be recovered using the "untrash" API endpoint.  Blocks are permanently deleted after they have been in the trash for the duration in @BlobTrashLifetime@.
 
-Keep-balance is also responsible for balancing the distribution of blocks across keepstore servers by asking servers to pull blocks from other servers (as determined by their "storage class":{{site.baseurl}}/admin/storage-classes.html and "rendezvous hashing order":{{site.baseurl}}/api/storage.html).  Pulling a block makes a copy.  If a block is overreplicated (i.e. there are excess copies) after pulling, it will be subsequently trashed on the original server.
+Keep-balance is also responsible for balancing the distribution of blocks across keepstore servers by asking servers to pull blocks from other servers (as determined by their "storage class":{{site.baseurl}}/admin/storage-classes.html and "rendezvous hashing order":{{site.baseurl}}/api/storage.html).  Pulling a block makes a copy.  If a block is overreplicated (i.e. there are excess copies) after pulling, it will be subsequently trashed and deleted on the original server, subject to @BlobTrash@ and @BlobTrashLifetime@ settings.
 
 h3. Configure storage volumes
 
index b52b706b26bbcfd4cf43df4e9b74c919f9417768..6806c8c6ce4ffa2b5c93dde2ca54f5d7e7754872 100644 (file)
@@ -497,7 +497,7 @@ func (v *AzureBlobVolume) Trash(loc string) error {
                return nil
        }
 
-       // If TrashLifetime == 0, just delete it
+       // If BlobTrashLifetime == 0, just delete it
        if v.cluster.Collections.BlobTrashLifetime == 0 {
                return v.container.DeleteBlob(loc, &storage.DeleteBlobOptions{
                        IfMatch: props.Etag,
@@ -567,7 +567,7 @@ func (v *AzureBlobVolume) isKeepBlock(s string) bool {
        return keepBlockRegexp.MatchString(s)
 }
 
-// EmptyTrash looks for trashed blocks that exceeded TrashLifetime
+// EmptyTrash looks for trashed blocks that exceeded BlobTrashLifetime
 // and deletes them from the volume.
 func (v *AzureBlobVolume) EmptyTrash() {
        if v.cluster.Collections.BlobDeleteConcurrency < 1 {
index 51031d3607e9ac810e083832c763be7ff423dfb0..c589e639f557782ad4a44ffec4a40eaf6b399c94 100644 (file)
@@ -149,13 +149,13 @@ func (h *handler) setup(ctx context.Context, cluster *arvados.Cluster, token str
        h.Cluster = cluster
        h.Logger = ctxlog.FromContext(ctx)
        if h.Cluster.API.MaxKeepBlobBuffers <= 0 {
-               return fmt.Errorf("MaxBuffers must be greater than zero")
+               return fmt.Errorf("API.MaxKeepBlobBuffers must be greater than zero")
        }
        bufs = newBufferPool(h.Logger, h.Cluster.API.MaxKeepBlobBuffers, BlockSize)
 
        if h.Cluster.API.MaxConcurrentRequests < 1 {
                h.Cluster.API.MaxConcurrentRequests = h.Cluster.API.MaxKeepBlobBuffers * 2
-               h.Logger.Warnf("MaxRequests <1 or not specified; defaulting to MaxKeepBlobBuffers * 2 == %d", h.Cluster.API.MaxConcurrentRequests)
+               h.Logger.Warnf("API.MaxConcurrentRequests <1 or not specified; defaulting to MaxKeepBlobBuffers * 2 == %d", h.Cluster.API.MaxConcurrentRequests)
        }
 
        if h.Cluster.Collections.BlobSigningKey != "" {
index 299460297f877635638f431f4bd58904a4ad2124..9d69b9fa47ef1b173b70e1f16617ba6dd9531351 100644 (file)
@@ -327,7 +327,7 @@ func (s *HandlerSuite) TestPutAndDeleteSkipReadonlyVolumes(c *check.C) {
 //   - authenticated   /index/prefix request | superuser
 //
 // The only /index requests that should succeed are those issued by the
-// superuser. They should pass regardless of the value of RequireSignatures.
+// superuser. They should pass regardless of the value of BlobSigning.
 //
 func (s *HandlerSuite) TestIndexHandler(c *check.C) {
        c.Assert(s.handler.setup(context.Background(), s.cluster, "", prometheus.NewRegistry(), testServiceURL), check.IsNil)
@@ -393,7 +393,7 @@ func (s *HandlerSuite) TestIndexHandler(c *check.C) {
        // => UnauthorizedError
        response := IssueRequest(s.handler, unauthenticatedReq)
        ExpectStatusCode(c,
-               "RequireSignatures on, unauthenticated request",
+               "permissions on, unauthenticated request",
                UnauthorizedError.HTTPCode,
                response)
 
@@ -520,7 +520,7 @@ func (s *HandlerSuite) TestDeleteHandler(c *check.C) {
        vols := s.handler.volmgr.AllWritable()
        vols[0].Put(context.Background(), TestHash, TestBlock)
 
-       // Explicitly set the BlobSignatureTTL to 0 for these
+       // Explicitly set the BlobSigningTTL to 0 for these
        // tests, to ensure the MockVolume deletes the blocks
        // even though they have just been created.
        s.cluster.Collections.BlobSigningTTL = arvados.Duration(0)
@@ -611,7 +611,7 @@ func (s *HandlerSuite) TestDeleteHandler(c *check.C) {
                c.Error("superuserExistingBlockReq: block not deleted")
        }
 
-       // A DELETE request on a block newer than BlobSignatureTTL
+       // A DELETE request on a block newer than BlobSigningTTL
        // should return success but leave the block on the volume.
        vols[0].Put(context.Background(), TestHash, TestBlock)
        s.cluster.Collections.BlobSigningTTL = arvados.Duration(time.Hour)
@@ -936,7 +936,7 @@ func (s *HandlerSuite) TestPutNeedsOnlyOneBuffer(c *check.C) {
        select {
        case <-ok:
        case <-time.After(time.Second):
-               c.Fatal("PUT deadlocks with MaxBuffers==1")
+               c.Fatal("PUT deadlocks with MaxKeepBlobBuffers==1")
        }
 }
 
index 22a38e20859dfaceeda16bedc90a59f035fda360..9fc87045e0c29a471cb13c5953b299851d648195 100644 (file)
@@ -113,7 +113,7 @@ const (
 var (
        // ErrS3TrashDisabled is returned by Trash if that operation
        // is impossible with the current config.
-       ErrS3TrashDisabled = fmt.Errorf("trash function is disabled because -trash-lifetime=0 and -s3-unsafe-delete=false")
+       ErrS3TrashDisabled = fmt.Errorf("trash function is disabled because Collections.BlobTrashLifetime=0 and DriverParameters.UnsafeDelete=false")
 
        s3ACL = s3.Private
 
@@ -663,7 +663,7 @@ func (v *S3Volume) translateError(err error) error {
        return err
 }
 
-// EmptyTrash looks for trashed blocks that exceeded TrashLifetime
+// EmptyTrash looks for trashed blocks that exceeded BlobTrashLifetime
 // and deletes them from the volume.
 func (v *S3Volume) EmptyTrash() {
        if v.cluster.Collections.BlobDeleteConcurrency < 1 {
@@ -712,8 +712,8 @@ func (v *S3Volume) EmptyTrash() {
                                // the raceWindow that starts if we
                                // delete trash/X now.
                                //
-                               // Note this means (TrashCheckInterval
-                               // < BlobSignatureTTL - raceWindow) is
+                               // Note this means (TrashSweepInterval
+                               // < BlobSigningTTL - raceWindow) is
                                // necessary to avoid starvation.
                                log.Printf("notice: %s: EmptyTrash: detected old race for %q, calling fixRace + Touch", v, loc)
                                v.fixRace(loc)
index b8c4458a5b363626289d2718a2507a450da18a5c..5c639d62952c06f63b69ad3274e5c7b9b9fa404b 100644 (file)
@@ -316,12 +316,12 @@ func (s *StubbedS3Suite) TestBackendStates(c *check.C) {
                        false, false, false, true, false, false,
                },
                {
-                       "Erroneously trashed during a race, detected before TrashLifetime",
+                       "Erroneously trashed during a race, detected before BlobTrashLifetime",
                        none, t0.Add(-30 * time.Minute), t0.Add(-29 * time.Minute),
                        true, false, true, true, true, false,
                },
                {
-                       "Erroneously trashed during a race, rescue during EmptyTrash despite reaching TrashLifetime",
+                       "Erroneously trashed during a race, rescue during EmptyTrash despite reaching BlobTrashLifetime",
                        none, t0.Add(-90 * time.Minute), t0.Add(-89 * time.Minute),
                        true, false, true, true, true, false,
                },
index 918555c2b12f6d21a172558c581f1a34c3c68870..6504f9c16b166cf7d5222f59988939beff878802 100644 (file)
@@ -418,9 +418,9 @@ func (v *UnixVolume) IndexTo(prefix string, w io.Writer) error {
 }
 
 // Trash trashes the block data from the unix storage
-// If TrashLifetime == 0, the block is deleted
+// If BlobTrashLifetime == 0, the block is deleted
 // Else, the block is renamed as path/{loc}.trash.{deadline},
-// where deadline = now + TrashLifetime
+// where deadline = now + BlobTrashLifetime
 func (v *UnixVolume) Trash(loc string) error {
        // Touch() must be called before calling Write() on a block.  Touch()
        // also uses lockfile().  This avoids a race condition between Write()
index 86143550220cc4d0098533d85a298400ea203118..1dea6194d51c88b195f6155392b233b879cbeee8 100644 (file)
@@ -170,12 +170,12 @@ type Volume interface {
 
        // Trash moves the block data from the underlying storage
        // device to trash area. The block then stays in trash for
-       // -trash-lifetime interval before it is actually deleted.
+       // BlobTrashLifetime before it is actually deleted.
        //
        // loc is as described in Get.
        //
        // If the timestamp for the given locator is newer than
-       // BlobSignatureTTL, Trash must not trash the data.
+       // BlobSigningTTL, Trash must not trash the data.
        //
        // If a Trash operation overlaps with any Touch or Put
        // operations on the same locator, the implementation must
@@ -196,8 +196,7 @@ type Volume interface {
        // reliably or fail outright.
        //
        // Corollary: A successful Touch or Put guarantees a block
-       // will not be trashed for at least BlobSignatureTTL
-       // seconds.
+       // will not be trashed for at least BlobSigningTTL seconds.
        Trash(loc string) error
 
        // Untrash moves block from trash back into store
@@ -216,8 +215,8 @@ type Volume interface {
        // secrets.
        String() string
 
-       // EmptyTrash looks for trashed blocks that exceeded TrashLifetime
-       // and deletes them from the volume.
+       // EmptyTrash looks for trashed blocks that exceeded
+       // BlobTrashLifetime and deletes them from the volume.
        EmptyTrash()
 
        // Return a globally unique ID of the underlying storage
index 683521c01a610c4d2d3d5d840f00a8214e72c3eb..cbb0eb3a3a68769c3ad9133e93a77ade565d35b2 100644 (file)
@@ -487,8 +487,8 @@ func (s *genericVolumeSuite) testDeleteNewBlock(t TB, factory TestableVolumeFact
 }
 
 // Calling Delete() for a block with a timestamp older than
-// BlobSignatureTTL seconds in the past should delete the data.
-// Test is intended for only writable volumes
+// BlobSigningTTL seconds in the past should delete the data.  Test is
+// intended for only writable volumes
 func (s *genericVolumeSuite) testDeleteOldBlock(t TB, factory TestableVolumeFactory) {
        s.setup(t)
        s.cluster.Collections.BlobSigningTTL.Set("5m")
@@ -834,7 +834,7 @@ func (s *genericVolumeSuite) testPutFullBlock(t TB, factory TestableVolumeFactor
        }
 }
 
-// With TrashLifetime != 0, perform:
+// With BlobTrashLifetime != 0, perform:
 // Trash an old block - which either raises ErrNotImplemented or succeeds
 // Untrash -  which either raises ErrNotImplemented or succeeds
 // Get - which must succeed
@@ -940,7 +940,8 @@ func (s *genericVolumeSuite) testTrashEmptyTrashUntrash(t TB, factory TestableVo
        err = v.Trash(TestHash)
        if err == MethodDisabledError || err == ErrNotImplemented {
                // Skip the trash tests for read-only volumes, and
-               // volume types that don't support TrashLifetime>0.
+               // volume types that don't support
+               // BlobTrashLifetime>0.
                return
        }