Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dbnode] Remove coldwrites error message until feature is ready #1651

Merged
merged 5 commits into from
May 20, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/dbnode/storage/series/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -79,7 +79,7 @@ type databaseBuffer interface {
id ident.ID,
tags ident.Tags,
persistFn persist.DataFn,
nsCtx namespace.Context,
nsCtx namespace.Context,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was poorly formatted before.

) error

Flush(
Expand Down Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should still return an error here, otherwise a write that's too old will look like it got written successfully. How about just changing the error message to something like "datapoint is too far in the past or future"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But for folks who have it disabled (everyone), won't the writeType equal ColdWrite for all writes with timestamp outside of the buffer? By removing this, if we get an old time stamp, won't we return one of the errors in the following lines? (Granted there is a small window for race condition between the two checks, but I assume our buffers can accept some variability there).

I can also just remove the writeType check completely, but the type is passed beyond this func.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checks in the following lines are the limits of ColdWrites and so checks using retentionPeriod/futureRetentionPeriod, instead of bufferPast/bufferFuture.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah missed that. Ok, I'll just change the original error msg then.

}
*/

if now.Add(-b.retentionPeriod).After(timestamp) {
return false, m3dberrors.ErrTooPast
Expand Down