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

feat: add option to flush WAL on shutdown #25444

Merged
merged 2 commits into from
Oct 10, 2024
Merged

Conversation

gwossum
Copy link
Member

@gwossum gwossum commented Oct 9, 2024

Add --storage-wal-flush-on-shutdown to flush WAL on database shutdown. On successful shutdown, all WAL data will be committed to TSM files and the WAL directories will not contain any .wal files.

Closes: #25422

Add `--storage-wal-flush-on-shutdown` to flush WAL on database shutdown.
On successful shutdown, all WAL data will be committed to TSM files and the
WAL directories will not contain any .wal files.

Closes: #25422
@gwossum gwossum added area/tsm kind/feature area/2.x OSS 2.0 related issues and PRs labels Oct 9, 2024
@gwossum gwossum self-assigned this Oct 9, 2024
Remove FlushWAL from tsdb.Engine interface make it a private method
on tsm1.Engine.

Add comment explaining why the directory layout for Store objects in
tests was changed.
@gwossum gwossum marked this pull request as ready for review October 10, 2024 19:59
Copy link
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

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

LGTM: this is really nice code.

t.Errorf("unexpected tsm-madv-willneed:\n\nexp=%v\n\ngot=%v\n\n", exp, got)
}
`, &c)
require.NoError(t, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice simplification

}
return err
return errors.Join(flushErr, setCloseErr, storeCloseErr, walCloseErr)
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice!

@gwossum gwossum merged commit 96bade4 into main-2.x Oct 10, 2024
25 checks passed
@gwossum gwossum deleted the gw/25422/wal-flush-2 branch October 10, 2024 20:27
gwossum added a commit that referenced this pull request Oct 10, 2024
Add `--storage-wal-flush-on-shutdown` to flush WAL on database shutdown.
On successful shutdown, all WAL data will be committed to TSM files and the
WAL directories will not contain any .wal files.

Clean cherry-pick of #25444 from main-2.x.

Closes: #25422
(cherry picked from commit 96bade4)
gwossum added a commit that referenced this pull request Oct 15, 2024
Add `--storage-wal-flush-on-shutdown` to flush WAL on database shutdown.
On successful shutdown, all WAL data will be committed to TSM files and the
WAL directories will not contain any .wal files.

Clean cherry-pick of #25444 from main-2.x.

Closes: #25422
(cherry picked from commit 96bade4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tsm area/2.x OSS 2.0 related issues and PRs kind/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants