Skip to content

Use a compact encoding for parallel scan seen-file state #3234

Description

@DrakeLin

Please describe why this is necessary.

Parallel scan state can contain a large HashSet<FileActionKey>. The convenience
ParallelState::into_bytes path currently serializes the entire SerializableScanState as JSON.
For large seen-file sets this repeats JSON structure, stores string lengths indirectly through
syntax, requires escaping, and creates substantial transient allocation and transfer volume.

SerializableScanState already documents that connectors may choose a compact binary
representation, but the built-in byte representation remains JSON and offers no compact default.

Describe the functionality you are proposing.

Introduce a versioned compact encoding for the seen-file keys used by the built-in parallel-state
byte path. One possible representation is a single length-prefixed byte buffer containing paths
and optional deletion-vector IDs. Keep the decoded in-memory hash set for lookup; this issue is
about serialization size and transient encode/decode memory, not replacing random-access dedup
state with a sequential buffer.

The format should:

  • preserve exact path and deletion-vector identity;
  • validate lengths and allocation bounds while decoding;
  • retain the equal-binary-version contract or carry an explicit format version; and
  • report clear errors for malformed or truncated input.

Benchmark serialized size, encode/decode time, and peak allocation against JSON for small and large
seen-file sets. If the default path is not worth changing, provide a reusable compact codec for
connectors instead.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions