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

Conversation

martin-mao
Copy link
Collaborator

What this PR does / why we need it:
When any datapoint outside of the buffer is currently written, the user gets back a msg saying that the coldWrites feature (which is not ready) is not enabled. This causes a lot of confusion.

@@ -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.

/*
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.

Copy link
Collaborator

@justinjc justinjc left a comment

Choose a reason for hiding this comment

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

LGTM with nit.

@@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: s/it's/its

@martin-mao martin-mao merged commit 5cbbf13 into master May 20, 2019
@prateek prateek deleted the martinm-fix-coldwrites-msg branch May 20, 2019 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants