Temporary EOF Log Marker#535
Conversation
ishanchadha01
commented
Nov 27, 2025
- includes UnifiedLogger lib definition
- implementation of temporary EOF marker that's overwritten when new log entry is written
- tests for the temporary marker and permanent marker
- mirrored functionality in SDLogger
|
|
| let header = SectionHeader { | ||
| magic: SECTION_MAGIC, | ||
| block_size: SECTION_HEADER_COMPACT_SIZE, | ||
| entry_type: UnifiedLogType::LastEntry, |
There was a problem hiding this comment.
Writing a new payload for basically a boolean is overkill.
I'd like to propose an alternative that might be better: as we write all the section header when we close them, we could add a "still open" boolean in all the section headers. The first time we create them we leave the boolean at open, then when we close them we flip the boolean (we write that sector anyway so it is almost free).
We use this flag on the temporary end marker to signal that as a while the entire log was not closed properly.
Like that the log reader can detect the still open / dirty sections when the log has not been closed properly.
Then we need to adapt the log reader and fsck to emit a warning that they stopped reading the log on a not cleanly closed log and list the sections that were still open (hinting to the user that they miss some data in there).
| fn write_end_marker(&mut self, temporary: bool) -> CuResult<()> { | ||
| let marker = EndOfLogMarker { temporary }; | ||
|
|
||
| let mut payload = [0u8; 32]; |
There was a problem hiding this comment.
I think this is overkill to create a payload for this. See below
|
thanks for the PR, see inside but I think we would be better off if we add this boolean on every section header see the comments in the review. |
…into ishanchadha01/temp-end-marker
|
Sounds good - i tried refactoring to use a boolean, the logic does seem simpler now |
|
Thx |
* lib definition, memmap impl and passing tests, sdlogger impl * replace payload with bool