Skip to content

refector: Add LiveManifestEntry - #3132

Open
xanderbailey wants to merge 1 commit into
apache:mainfrom
xanderbailey:xb/live-manifest
Open

refector: Add LiveManifestEntry#3132
xanderbailey wants to merge 1 commit into
apache:mainfrom
xanderbailey:xb/live-manifest

Conversation

@xanderbailey

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

What changes are included in this PR?

This PR adds LiveManifestEntry, an internal representation used during scan planning. ManifestEntry continues to reflect the serialized manifest format, where sequence_number is optional because an ADDED entry may inherit it from the containing manifest. After inheritance, however, every live entry must have a data sequence number, so LiveManifestEntry represents that the value is required.

The distinction also preserves compatibility with older v2 manifests that contain deleted entries with null data sequence numbers. Those entries can still be parsed and ignored because they are no longer live, while an ADDED or EXISTING entry that remains null after inheritance is treated as invalid data.

This invariant is intentionally not enforced in ManifestReader::read. The manifest reader loads the complete manifest, including deleted historical entries, and is used outside scan planning. Rejecting null sequence numbers there would make an otherwise readable manifest fail because of an entry that cannot affect the current snapshot. Instead, the scan path applies inheritance first, filters out deleted entries, and then converts the remaining entries into LiveManifestEntry.

Scan and delete-index code now operate on LiveManifestEntry, removing optional sequence-number comparisons and the previous fallback that applied deletes unconditionally when the data sequence number was missing.

Are these changes tested?

AI Disclosure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant