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

Ignore validity window during wal replay #4596

Merged

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Oct 29, 2021

This fixes a possible bug that could occur when moving from ingester.max-chunk-age=x -> ingester.max-chunk-age=y where y < x. The max-chunk-age parameterizes how far behind incoming writes are allowed to be and decreasing this validity window then replaying an existing WAL could result in dropped data during recovery. This PR ensures that previously accepted data in the WAL will be accepted during replay, even after the validity window is lowered.

@owen-d owen-d requested a review from a team as a code owner October 29, 2021 16:23
_, err = s.Push(context.Background(), entries, recordPool.GetRecord(), 0)
require.NotNil(t, err)

// Now pretend it's a replay. The same write should succeed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

thank you for these comments, very helpful!

Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

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

LGTM

@owen-d owen-d merged commit 633b4ca into grafana:main Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants