diff --git a/go.mod b/go.mod index afbc250e66e..2ff339baf49 100644 --- a/go.mod +++ b/go.mod @@ -62,7 +62,7 @@ require ( replace ( github.com/golang/lint => golang.org/x/lint v0.0.0-20190409202823-959b441ac422 github.com/v3io/frames => github.com/v3io/frames v0.8.10 - github.com/v3io/v3io-tsdb => github.com/v3io/v3io-tsdb v0.11.7 + github.com/v3io/v3io-tsdb => github.com/v3io/v3io-tsdb v0.11.8 google.golang.org/grpc => google.golang.org/grpc v1.19.1 k8s.io/klog => github.com/simonpasquier/klog-gokit v0.1.0 ) diff --git a/go.sum b/go.sum index 2b3ca40e4b0..f85969a5c66 100644 --- a/go.sum +++ b/go.sum @@ -389,24 +389,14 @@ github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tinylib/msgp v1.1.1 h1:TnCZ3FIuKeaIy+F45+Cnp+caqdXGy4z74HvwXN+570Y= github.com/tinylib/msgp v1.1.1/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/v3io/frames v0.8.1 h1:wUWCX6RUEQ05SG3P9VtMBYh7gWrYNOiA81HcWXRXGZw= -github.com/v3io/frames v0.8.1/go.mod h1:qQnXBGO3uLKwN9HVcQ2ggHlIs8xT+200uJaWUgDocpk= github.com/v3io/frames v0.8.10 h1:0zzsNVQLBF4Tl08ZcyTthMfefvfkvsICpgcMVPztcGA= github.com/v3io/frames v0.8.10/go.mod h1:WmtH4jAi7gnULRagJ7t5rc/tLoTK/Nd2zmOesQT9mXY= github.com/v3io/v3io-go v0.1.9 h1:etkrrRmrI++i8sxGfK/+13f41TxIMohYeZHwVUM62vw= github.com/v3io/v3io-go v0.1.9/go.mod h1:5poBlcjZG5TiexRTYI44PE6tHzZz5Z60w+iS899pWtc= github.com/v3io/v3io-go v0.2.5-0.20210113095419-6c806b8d5186 h1:cHzR1AKhoBVVPNBGt8ekQwXI4wzER1KRb3J3IhJaWao= github.com/v3io/v3io-go v0.2.5-0.20210113095419-6c806b8d5186/go.mod h1:WGxAG5MfZ5FeeZa7yGzocW+iLxTlrpkOWdnCIty4QDc= -github.com/v3io/v3io-tsdb v0.11.3 h1:zH2rVNsPy9CIm0/gwJ7NNyjDD7G2w4XhUygeZqexLaE= -github.com/v3io/v3io-tsdb v0.11.3/go.mod h1:kp586KxTfROIGwb/nzNxwDbX2Wterxro+HbiZHmK548= -github.com/v3io/v3io-tsdb v0.11.4 h1:tDw+EdFNregIy6r4fPqtOybkAj4ngUl4WRQNH24Xe0M= -github.com/v3io/v3io-tsdb v0.11.4/go.mod h1:kp586KxTfROIGwb/nzNxwDbX2Wterxro+HbiZHmK548= -github.com/v3io/v3io-tsdb v0.11.5 h1:PMrkb2B7No7Ghe9e+qezen8+3v/L2ZGdkRYCIhL7D0Q= -github.com/v3io/v3io-tsdb v0.11.5/go.mod h1:kp586KxTfROIGwb/nzNxwDbX2Wterxro+HbiZHmK548= -github.com/v3io/v3io-tsdb v0.11.6 h1:G8Gn+RNEMS8zFLafoSaMzaCu65vJyJr/wx91a+g+KZ0= -github.com/v3io/v3io-tsdb v0.11.6/go.mod h1:uyk46LJxROChqmlhg5M5Kw7qK1WfJD3hrqNHR6kLjeg= -github.com/v3io/v3io-tsdb v0.11.7 h1:X1Wqu0L+WVuz9DnmE2o26hW03v39kQlqFkt65LepmBI= -github.com/v3io/v3io-tsdb v0.11.7/go.mod h1:zAz77gck9fjlC+lPbbq4JBHitP3rv4KLWR/YUuFjJcU= +github.com/v3io/v3io-tsdb v0.11.8 h1:g6fvBgdp57zILC1T2yml9qRcCRVtFsXSKZh7kbeGFpc= +github.com/v3io/v3io-tsdb v0.11.8/go.mod h1:zAz77gck9fjlC+lPbbq4JBHitP3rv4KLWR/YUuFjJcU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.2.0 h1:dzZJf2IuMiclVjdw0kkT+f9u4YdrapbNyGAN47E/qnk= @@ -417,6 +407,7 @@ github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 h1:zzrxE1FKn5ryB github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY= go.mongodb.org/mongo-driver v1.0.3 h1:GKoji1ld3tw2aC+GX1wbr/J2fX13yNacEYoJ8Nhr0yU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -465,6 +456,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/vendor/github.com/v3io/v3io-tsdb/pkg/tsdb/v3iotsdb.go b/vendor/github.com/v3io/v3io-tsdb/pkg/tsdb/v3iotsdb.go index fb7c39cf254..b346403da5d 100644 --- a/vendor/github.com/v3io/v3io-tsdb/pkg/tsdb/v3iotsdb.go +++ b/vendor/github.com/v3io/v3io-tsdb/pkg/tsdb/v3iotsdb.go @@ -26,6 +26,7 @@ import ( "encoding/json" "fmt" "math" + "net/http" pathUtil "path" "path/filepath" "strconv" @@ -37,6 +38,7 @@ import ( "github.com/pkg/errors" "github.com/v3io/v3io-go/pkg/dataplane" "github.com/v3io/v3io-go/pkg/dataplane/http" + v3ioerrors "github.com/v3io/v3io-go/pkg/errors" "github.com/v3io/v3io-tsdb/pkg/aggregate" "github.com/v3io/v3io-tsdb/pkg/appender" "github.com/v3io/v3io-tsdb/pkg/chunkenc" @@ -95,14 +97,24 @@ func CreateTSDB(cfg *config.V3ioConfig, schema *config.Schema, container v3io.Co path := pathUtil.Join(cfg.TablePath, config.SchemaConfigFileName) // Check whether the config file already exists, and abort if it does - _, err = container.GetObjectSync(&v3io.GetObjectInput{Path: path, DataPlaneInput: dataPlaneInput}) - if err == nil { - return fmt.Errorf("A TSDB table already exists at path '" + cfg.TablePath + "'.") - } - - err = container.PutObjectSync(&v3io.PutObjectInput{Path: path, Body: data, DataPlaneInput: dataPlaneInput}) - if err != nil { - return errors.Wrapf(err, "Failed to create a TSDB schema at path '%s/%s/%s'.", cfg.WebAPIEndpoint, cfg.Container, path) + for i := 0; i < 8; i++ { + _, err = container.GetObjectSync(&v3io.GetObjectInput{Path: path, DataPlaneInput: dataPlaneInput}) + if err == nil { + return fmt.Errorf("A TSDB table already exists at path '" + cfg.TablePath + "'.") + } else if e, hasStatusCode := err.(v3ioerrors.ErrorWithStatusCode); hasStatusCode && e.StatusCode() != http.StatusNotFound { + err = errors.Wrapf(err, "Failed to check TSDB schema at path '%s/%s/%s'.", cfg.WebAPIEndpoint, cfg.Container, path) + lgr.Error(err) + } else { + // if no tsdb schema found + err = container.PutObjectSync(&v3io.PutObjectInput{Path: path, Body: data, DataPlaneInput: dataPlaneInput}) + if err != nil { + err = errors.Wrapf(err, "Failed to create a TSDB schema at path '%s/%s/%s'.", cfg.WebAPIEndpoint, cfg.Container, path) + lgr.Error(err) + } else { + lgr.Info("Successfully created TSDB schema at path '%s/%s/%s'.", cfg.WebAPIEndpoint, cfg.Container, path) + break + } + } } return err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 593e1995633..2ae0271121e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -341,7 +341,7 @@ github.com/v3io/v3io-go/pkg/dataplane github.com/v3io/v3io-go/pkg/dataplane/http github.com/v3io/v3io-go/pkg/dataplane/schemas/node/common github.com/v3io/v3io-go/pkg/errors -# github.com/v3io/v3io-tsdb v0.11.6 => github.com/v3io/v3io-tsdb v0.11.7 +# github.com/v3io/v3io-tsdb v0.11.6 => github.com/v3io/v3io-tsdb v0.11.8 github.com/v3io/v3io-tsdb/internal/pkg/performance github.com/v3io/v3io-tsdb/pkg/aggregate github.com/v3io/v3io-tsdb/pkg/appender