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

Improve Wal Replay #668

Merged
merged 15 commits into from
Apr 23, 2021
Merged

Improve Wal Replay #668

merged 15 commits into from
Apr 23, 2021

Conversation

joe-elliott
Copy link
Member

@joe-elliott joe-elliott commented Apr 23, 2021

What this PR does:
For simplicity the current WAL replay code loads a file, iterates through all records and replays them into an ingester instance. This creates two issues:

  • We are doubling our disk needs for a brief time period while the WAL replays and rebuilds itself in a second file. In our internal ops cluster we have seen this lead to failed WAL replays.
  • There is a lot of overhead to reading an entire multi GB file and rewriting it back to disk.

This proposed fix iterates through the WAL as is and simply rebuilds the index in memory for the AppendBlock to use directly instead of rebuilding a new file.

Which issue(s) this PR fixes:
Fixes #409

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
tempodb/wal/wal.go Outdated Show resolved Hide resolved
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott joe-elliott merged commit 0b72812 into grafana:main Apr 23, 2021
@joe-elliott joe-elliott mentioned this pull request Apr 26, 2021
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.

Ingesters with many WAL files will concatenate them on restart
2 participants