Skip to content

last_epochs_offsets could potentially return offsets pointing to missing data #145

@kjnilsson

Description

@kjnilsson

Describe the bug

This function does not check that an entry in the index is also valid in the segment and thus can return values that are not valid. For normal operation this is fine as the index is always written to after the segment. However if there is an unclean node shutdown where the page cache is lost it is/appears possible that the index will contain data not also present in the segment (due to data re-ordering at the storage layer or file system).

Reproduction steps

  1. Truncating some data from the segment file then running the function should be sufficient to show it returning offsets not present in the segment.

Expected behavior

It should include only valid epoch offsets.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions