Skip to content

wal: Do not truncate in NewWriter#44886

Merged
joamaki merged 1 commit intocilium:mainfrom
joamaki:pr/joamaki/wal-no-trunc
Mar 19, 2026
Merged

wal: Do not truncate in NewWriter#44886
joamaki merged 1 commit intocilium:mainfrom
joamaki:pr/joamaki/wal-no-trunc

Conversation

@joamaki
Copy link
Copy Markdown
Contributor

@joamaki joamaki commented Mar 19, 2026

Truncating the existing log opens up for races where the WAL is empty and we haven't re-populated it with e.g. [Compact]. It's also was not obvious to users of pkg/wal (e.g. me) that on restart one needs to ensure that the existing entries need to be replayed into the WAL as otherwise they disappear.

Fix this by not truncating which keeps us appending to the log until [Compact] is called to reset log.

Truncating the existing log opens up for races where the WAL is empty
and we haven't re-populated it with e.g. [Compact]. It's also was not
obvious to users of pkg/wal (e.g. me) that on restart one needs to ensure
that the existing entries need to be replayed into the WAL as otherwise
they disappear.

Fix this by not truncating which keeps us appending to the log until
[Compact] is called to reset log.

Signed-off-by: Jussi Maki <jussi@isovalent.com>
@joamaki joamaki added the release-note/misc This PR makes changes that have no direct user impact. label Mar 19, 2026
@joamaki joamaki marked this pull request as ready for review March 19, 2026 13:32
@joamaki joamaki requested a review from a team as a code owner March 19, 2026 13:32
@joamaki joamaki requested review from derailed and removed request for derailed March 19, 2026 13:32
@joamaki
Copy link
Copy Markdown
Contributor Author

joamaki commented Mar 19, 2026

/test

1 similar comment
@cilium-ariane
Copy link
Copy Markdown

cilium-ariane bot commented Mar 19, 2026

/test

@joamaki joamaki enabled auto-merge March 19, 2026 14:01
@gandro
Copy link
Copy Markdown
Member

gandro commented Mar 19, 2026

This is not a bug fix that we have to backport?

@joamaki joamaki added needs-backport/1.19 This PR / issue needs backporting to the v1.19 branch release-note/bug This PR fixes an issue in a previous release of Cilium. and removed release-note/misc This PR makes changes that have no direct user impact. labels Mar 19, 2026
@joamaki joamaki added this pull request to the merge queue Mar 19, 2026
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 19, 2026
Merged via the queue into cilium:main with commit cf9dfdf Mar 19, 2026
81 of 85 checks passed
@joamaki joamaki deleted the pr/joamaki/wal-no-trunc branch March 19, 2026 16:59
@tklauser tklauser mentioned this pull request Mar 24, 2026
5 tasks
@tklauser tklauser added backport-pending/1.19 The backport for Cilium 1.19.x for this PR is in progress. and removed needs-backport/1.19 This PR / issue needs backporting to the v1.19 branch labels Mar 24, 2026
@github-actions github-actions bot added backport-done/1.19 The backport for Cilium 1.19.x for this PR is done. and removed backport-pending/1.19 The backport for Cilium 1.19.x for this PR is in progress. labels Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-done/1.19 The backport for Cilium 1.19.x for this PR is done. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants