[ARVADOS] updated: 825c718d771718a3106b1d7608436c7b1635a846
Git user
git at public.curoverse.com
Fri May 6 15:33:39 EDT 2016
Summary of changes:
services/keepstore/azure_blob_volume.go | 7 +++----
services/keepstore/volume_generic_test.go | 32 ++++++++++++-------------------
2 files changed, 15 insertions(+), 24 deletions(-)
via 825c718d771718a3106b1d7608436c7b1635a846 (commit)
from 7b5798a7ab66c40c4a3feb028fc06478f40bd425 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 825c718d771718a3106b1d7608436c7b1635a846
Author: radhika <radhika at curoverse.com>
Date: Fri May 6 15:33:06 2016 -0400
8556: converted noMoreOldMarkers into a loop label.
diff --git a/services/keepstore/azure_blob_volume.go b/services/keepstore/azure_blob_volume.go
index b3811fc..9f29583 100644
--- a/services/keepstore/azure_blob_volume.go
+++ b/services/keepstore/azure_blob_volume.go
@@ -489,10 +489,10 @@ var azTrashLocRegexp = regexp.MustCompile(`trash\.(\d+)\.([0-9a-f]{32})$`)
func (v *AzureBlobVolume) EmptyTrash() {
var bytesDeleted, bytesInTrash int64
var blocksDeleted, blocksInTrash int
- var noMoreOldMarkers bool
params := storage.ListBlobsParameters{
Prefix: "trash.",
}
+blobListPage:
for {
resp, err := v.bsClient.ListBlobs(v.containerName, params)
if err != nil {
@@ -512,8 +512,7 @@ func (v *AzureBlobVolume) EmptyTrash() {
continue
}
if deadline > time.Now().Unix() {
- noMoreOldMarkers = true
- break
+ break blobListPage
}
metadata, err := v.bsClient.GetBlobMetadata(v.containerName, matches[2])
@@ -536,7 +535,7 @@ func (v *AzureBlobVolume) EmptyTrash() {
log.Printf("EmptyTrash: %v: DeleteBlob(%v): %v", b.Name, err)
}
}
- if resp.NextMarker == "" || noMoreOldMarkers == true {
+ if resp.NextMarker == "" {
break
}
params.Marker = resp.NextMarker
diff --git a/services/keepstore/volume_generic_test.go b/services/keepstore/volume_generic_test.go
index a3321cc..1765040 100644
--- a/services/keepstore/volume_generic_test.go
+++ b/services/keepstore/volume_generic_test.go
@@ -790,6 +790,17 @@ func testTrashEmptyTrashUntrash(t TB, factory TestableVolumeFactory) {
if bytes.Compare(buf[:n], TestBlock) != 0 {
t.Fatalf("Got data %+q, expected %+q", buf[:n], TestBlock)
}
+
+ _, err = v.Mtime(TestHash)
+ if err != nil {
+ return err
+ }
+
+ err = v.Compare(TestHash, TestBlock)
+ if err != nil {
+ return err
+ }
+
return nil
}
@@ -805,6 +816,7 @@ func testTrashEmptyTrashUntrash(t TB, factory TestableVolumeFactory) {
t.Fatal(err)
}
+ // Trash the block
err = v.Trash(TestHash)
if err == MethodDisabledError || err == ErrNotImplemented {
// Skip the trash tests for read-only volumes, and
@@ -817,16 +829,6 @@ func testTrashEmptyTrashUntrash(t TB, factory TestableVolumeFactory) {
t.Fatalf("os.IsNotExist(%v) should have been true", err)
}
- _, err = v.Mtime(TestHash)
- if err == nil || !os.IsNotExist(err) {
- t.Fatalf("os.IsNotExist(%v) should have been true", err)
- }
-
- err = v.Compare(TestHash, TestBlock)
- if err == nil || !os.IsNotExist(err) {
- t.Fatalf("os.IsNotExist(%v) should have been true", err)
- }
-
indexBuf := new(bytes.Buffer)
v.IndexTo("", indexBuf)
if strings.Contains(string(indexBuf.Bytes()), TestHash) {
@@ -852,16 +854,6 @@ func testTrashEmptyTrashUntrash(t TB, factory TestableVolumeFactory) {
t.Fatal(err)
}
- _, err = v.Mtime(TestHash)
- if err != nil {
- t.Fatal(err)
- }
-
- err = v.Compare(TestHash, TestBlock)
- if err != nil {
- t.Fatal(err)
- }
-
indexBuf = new(bytes.Buffer)
v.IndexTo("", indexBuf)
if !strings.Contains(string(indexBuf.Bytes()), TestHash) {
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list