From ce614f444cc4b00d6979e03bfe026e0d6a469d89 Mon Sep 17 00:00:00 2001 From: Martin Mao Date: Mon, 20 May 2019 09:40:16 -0700 Subject: [PATCH 1/5] Remove coldwrites error message until feature is ready --- src/dbnode/storage/series/buffer.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/dbnode/storage/series/buffer.go b/src/dbnode/storage/series/buffer.go index f646397560..10c459e63f 100644 --- a/src/dbnode/storage/series/buffer.go +++ b/src/dbnode/storage/series/buffer.go @@ -29,10 +29,10 @@ import ( "github.com/m3db/m3/src/dbnode/clock" "github.com/m3db/m3/src/dbnode/digest" "github.com/m3db/m3/src/dbnode/encoding" + "github.com/m3db/m3/src/dbnode/namespace" "github.com/m3db/m3/src/dbnode/persist" "github.com/m3db/m3/src/dbnode/storage/block" m3dberrors "github.com/m3db/m3/src/dbnode/storage/errors" - "github.com/m3db/m3/src/dbnode/namespace" "github.com/m3db/m3/src/dbnode/ts" "github.com/m3db/m3/src/dbnode/x/xio" "github.com/m3db/m3/src/x/context" @@ -79,7 +79,7 @@ type databaseBuffer interface { id ident.ID, tags ident.Tags, persistFn persist.DataFn, - nsCtx namespace.Context, + nsCtx namespace.Context, ) error Flush( @@ -246,9 +246,12 @@ func (b *dbBuffer) Write( writeType := b.ResolveWriteType(timestamp, now) if writeType == ColdWrite { - if !b.coldWritesEnabled { - return false, m3dberrors.ErrColdWritesNotEnabled - } + /* + Disable until cold writes is ready as this is confusing to users + if !b.coldWritesEnabled { + return false, m3dberrors.ErrColdWritesNotEnabled + } + */ if now.Add(-b.retentionPeriod).After(timestamp) { return false, m3dberrors.ErrTooPast From 93837b9041f3bcc71c64e72ab56498dc1d38837b Mon Sep 17 00:00:00 2001 From: Martin Mao Date: Mon, 20 May 2019 10:08:20 -0700 Subject: [PATCH 2/5] Add full stop --- src/dbnode/storage/series/buffer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbnode/storage/series/buffer.go b/src/dbnode/storage/series/buffer.go index 10c459e63f..54c134e20a 100644 --- a/src/dbnode/storage/series/buffer.go +++ b/src/dbnode/storage/series/buffer.go @@ -247,7 +247,7 @@ func (b *dbBuffer) Write( if writeType == ColdWrite { /* - Disable until cold writes is ready as this is confusing to users + Disable until cold writes is ready as this is confusing to users. if !b.coldWritesEnabled { return false, m3dberrors.ErrColdWritesNotEnabled } From 9cbf7892657f803995a25b0d630626e1398c81db Mon Sep 17 00:00:00 2001 From: Martin Mao Date: Mon, 20 May 2019 11:33:39 -0700 Subject: [PATCH 3/5] Change error msg instead --- src/dbnode/storage/errors/types.go | 5 +++-- src/dbnode/storage/series/buffer.go | 10 ++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/dbnode/storage/errors/types.go b/src/dbnode/storage/errors/types.go index 7854185c52..482a0e4d7a 100644 --- a/src/dbnode/storage/errors/types.go +++ b/src/dbnode/storage/errors/types.go @@ -35,9 +35,10 @@ var ( ErrTooPast = xerrors.NewInvalidParamsError(errors.New("datapoint is too far in the past")) // ErrColdWritesNotEnabled is returned when cold writes are disabled - // and a write is too far in the past or future. + // and a write is too far in the past or future. Note, the error intentionally + // excludes anything regarding the cold writes feature until it's release. ErrColdWritesNotEnabled = xerrors.NewInvalidParamsError(errors.New( - "cold writes not enabled and datapoint is too far in the past or future")) + "datapoint is too far in the past or future")) ) // NewUnknownNamespaceError returns a new error indicating an unknown namespace parameter. diff --git a/src/dbnode/storage/series/buffer.go b/src/dbnode/storage/series/buffer.go index 54c134e20a..8aa09e09b6 100644 --- a/src/dbnode/storage/series/buffer.go +++ b/src/dbnode/storage/series/buffer.go @@ -246,12 +246,10 @@ func (b *dbBuffer) Write( writeType := b.ResolveWriteType(timestamp, now) if writeType == ColdWrite { - /* - Disable until cold writes is ready as this is confusing to users. - if !b.coldWritesEnabled { - return false, m3dberrors.ErrColdWritesNotEnabled - } - */ + + if !b.coldWritesEnabled { + return false, m3dberrors.ErrColdWritesNotEnabled + } if now.Add(-b.retentionPeriod).After(timestamp) { return false, m3dberrors.ErrTooPast From d2f38ef7c38565caf2049fddbf8f0ab7f36c118d Mon Sep 17 00:00:00 2001 From: Martin Mao Date: Mon, 20 May 2019 11:34:40 -0700 Subject: [PATCH 4/5] Fix formatting --- src/dbnode/storage/series/buffer.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dbnode/storage/series/buffer.go b/src/dbnode/storage/series/buffer.go index 8aa09e09b6..1489eebdab 100644 --- a/src/dbnode/storage/series/buffer.go +++ b/src/dbnode/storage/series/buffer.go @@ -246,7 +246,6 @@ func (b *dbBuffer) Write( writeType := b.ResolveWriteType(timestamp, now) if writeType == ColdWrite { - if !b.coldWritesEnabled { return false, m3dberrors.ErrColdWritesNotEnabled } From 80fca425b00516bf30f785aba5f210771e5b5a5f Mon Sep 17 00:00:00 2001 From: Martin Mao Date: Mon, 20 May 2019 11:37:57 -0700 Subject: [PATCH 5/5] Fix spelling --- src/dbnode/storage/errors/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbnode/storage/errors/types.go b/src/dbnode/storage/errors/types.go index 482a0e4d7a..6d55d62735 100644 --- a/src/dbnode/storage/errors/types.go +++ b/src/dbnode/storage/errors/types.go @@ -36,7 +36,7 @@ var ( // ErrColdWritesNotEnabled is returned when cold writes are disabled // and a write is too far in the past or future. Note, the error intentionally - // excludes anything regarding the cold writes feature until it's release. + // excludes anything regarding the cold writes feature until its release. ErrColdWritesNotEnabled = xerrors.NewInvalidParamsError(errors.New( "datapoint is too far in the past or future")) )