Skip to content

[Vindex] WalWriter improvements#15

Merged
mhutchinson merged 3 commits into
transparency-dev:mainfrom
mhutchinson:walFun
Jul 30, 2025
Merged

[Vindex] WalWriter improvements#15
mhutchinson merged 3 commits into
transparency-dev:mainfrom
mhutchinson:walFun

Conversation

@mhutchinson
Copy link
Copy Markdown
Contributor

Refactorings:

  • move WAL stuff into its own files
  • changed to use a factory method

Changed validation to allow truncating any trailing junk after the last
newline. This makes it more tolerant when recovering from a partial
fsync during a previous write.

It also demonstrates that we can truncate the file, which will be useful
in the next PR. When ingesting entries from the log, we want to ensure
that they match the input log checkpoint commitment. To do this, we will
construct a compact range while performing all of the mappings. The WAL
will be written as soon as information is available, and periodically we
will write the compact range and tree size to disk. This means that on
recovery, we may need to throw away any entries in the WAL that are
beyond this compact range commitment. This is where truncation will be
needed, and this validation code will be provided with an index to
truncate everything after.

Changed to use a factory method

Changed validation to allow truncating any trailing junk after the last
newline. This makes it more tolerant when recovering from a partial
fsync during a previous write.

It also demonstrates that we can truncate the file, which will be useful
in the next PR. When ingesting entries from the log, we want to ensure
that they match the input log checkpoint commitment. To do this, we will
construct a compact range while performing all of the mappings. The WAL
will be written as soon as information is available, and periodically we
will write the compact range and tree size to disk. This means that on
recovery, we may need to throw away any entries in the WAL that are
beyond this compact range commitment. This is where truncation will be
needed, and this validation code will be provided with an index to
truncate everything after.
Copy link
Copy Markdown
Contributor

@AlCutter AlCutter left a comment

Choose a reason for hiding this comment

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

LGTM % the missing err check in the test.

@mhutchinson mhutchinson merged commit b8f025b into transparency-dev:main Jul 30, 2025
6 checks passed
@mhutchinson mhutchinson deleted the walFun branch July 30, 2025 13:55
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.

2 participants