Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: server/logdog/storage/bigtable/bigtable.go

Issue 1874563005: Archivist asserts completeness through keys scan. (Closed) Base URL: https://github.com/luci/luci-go@logdog-storage-keysonly
Patch Set: Remove unused members. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « server/internal/logdog/archivist/storageSource.go ('k') | server/logdog/storage/bigtable/bigtable_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/logdog/storage/bigtable/bigtable.go
diff --git a/server/logdog/storage/bigtable/bigtable.go b/server/logdog/storage/bigtable/bigtable.go
index 7ac745be25ad4873cbf1c54bdf694dd3eddea4ea..c531475827c49eeaa88a93df2b1a134e2920de7f 100644
--- a/server/logdog/storage/bigtable/bigtable.go
+++ b/server/logdog/storage/bigtable/bigtable.go
@@ -8,7 +8,6 @@ import (
"fmt"
"time"
- "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/grpcutil"
"github.com/luci/luci-go/server/logdog/storage"
"golang.org/x/net/context"
@@ -76,7 +75,7 @@ func (t *btTableProd) putLogData(c context.Context, rk *rowKey, data []byte) err
rowExists := false
if err := t.logTable.Apply(c, rk.encode(), cm, bigtable.GetCondMutationResult(&rowExists)); err != nil {
- return wrapTransient(err)
+ return grpcutil.WrapIfTransient(err)
}
if rowExists {
return storage.ErrExists
@@ -122,10 +121,13 @@ func (t *btTableProd) getLogData(c context.Context, rk *rowKey, limit int, keysO
}
return true
}, ropts...)
- if err == nil {
- err = innerErr
+ if err != nil {
+ return grpcutil.WrapIfTransient(err)
}
- return wrapTransient(err)
+ if innerErr != nil {
+ return innerErr
+ }
+ return nil
}
func (t *btTableProd) setMaxLogAge(c context.Context, d time.Duration) error {
@@ -134,28 +136,11 @@ func (t *btTableProd) setMaxLogAge(c context.Context, d time.Duration) error {
logGCPolicy = bigtable.MaxAgePolicy(d)
}
if err := t.adminClient.SetGCPolicy(c, t.LogTable, logColumnFamily, logGCPolicy); err != nil {
- return wrapTransient(err)
+ return grpcutil.WrapIfTransient(err)
}
return nil
}
-// wrapTransient wraps the supplied error in an errors.TransientError if it is
-// transient.
-func wrapTransient(err error) error {
- if isTransient(err) {
- err = errors.WrapTransient(err)
- }
- return err
-}
-
-// isTransient tests if a BigTable SDK error is transient.
-//
-// Since the BigTable API doesn't give us this information, we will identify
-// transient errors by parsing their error string :(
-func isTransient(err error) bool {
- return (err != errStop) && grpcutil.IsTransient(err)
-}
-
// getLogRowData loads the []byte contents of the supplied log row.
//
// If the row doesn't exist, storage.ErrDoesNotExist will be returned.
« no previous file with comments | « server/internal/logdog/archivist/storageSource.go ('k') | server/logdog/storage/bigtable/bigtable_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698