Skip to content

feat: add option to flush WAL on shutdown#25444

Merged
gwossum merged 2 commits intomain-2.xfrom
gw/25422/wal-flush-2
Oct 10, 2024
Merged

feat: add option to flush WAL on shutdown#25444
gwossum merged 2 commits intomain-2.xfrom
gw/25422/wal-flush-2

Conversation

@gwossum
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice simplification

walCloseErr = e.WAL.Close()
}
return err
return errors.Join(flushErr, setCloseErr, storeCloseErr, walCloseErr)
Copy link
Copy Markdown
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
@gwossum gwossum deleted the gw/25422/wal-flush-2 branch October 10, 2024 20:27
@gwossum gwossum mentioned this pull request Oct 10, 2024
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