Skip to content

tsdb wal always includes labels with chunks for replay consistency #9444

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented May 10, 2023

After debugging a WAL replay corruption, we found a situation where we were trying to replay chunks written but the labels wal record was missing. I haven't found out how this is possible, so in the meantime this adds a new record format which writes the labels alongside the chunks in the same record. This will result in some data duplication but should be more reliable since chunks can't be replayed into missing series. Given that chunk flushes are orders of magnitude less common than entry pushes, this shouldn't introduce a performance bottleneck in any meaningful way.

I've added a followup commit to be reverted later which continues to write the old multi-record format while being capable of reading both new and old formats. This means we can roll out the readonly version with this commit as a rollback target before we revert the commit and begin writing the new format.

@owen-d owen-d requested a review from a team as a code owner May 10, 2023 20:15
if len(record.Chks.Chks) > 0 {
r := &WALRecord{
UserID: record.UserID,
Chks: record.Chks,
Copy link
Contributor

Choose a reason for hiding this comment

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

double checking: don't you want Series here too? (in case they're >0)

owen-d added 3 commits May 31, 2023 14:24
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
@owen-d owen-d force-pushed the tsdb/verbose-wal branch from d4717ed to 0175093 Compare May 31, 2023 21:51
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants