Skip to content

test(dataset): characterize metadata amplification on wide tables - #9103

Open
hiltonhe wants to merge 1 commit into
lance-format:mainfrom
hiltonhe:cg-manifest/04-wide-table-metadata-test
Open

hiltonhe wants to merge 1 commit into
lance-format:mainfrom
hiltonhe:cg-manifest/04-wide-table-metadata-test

Conversation

@hiltonhe

@hiltonhe hiltonhe commented Sep 9, 2026

Copy link
Copy Markdown

Summary

Characterization tests that pin the observable metadata costs of the
full-snapshot manifest on a 256-column dataset, using the built-in
object-store IO tracker (same pattern as the lazy-column-metadata tests):

  • adding one column rewrites at least the previous manifest size of bytes;
  • a cold open reads at least the manifest size, even for a narrow query;
  • after another writer commits, the next checkout_latest re-reads the
    full manifest even though the reader's projection did not change.

Motivation

These document current behavior for wide tables — context and measurements
in the RFC discussion #9096. They are expected to be relaxed by any future
change that reduces metadata amplification; that change should update
these assertions in the same PR.

How tested

  • cargo test -p lance --lib dataset::tests::dataset_wide_table (3 tests pass)
  • cargo clippy -p lance --all-targets -- -D warnings

The manifest is a full snapshot, so a one-column add re-serializes the
whole manifest and the transaction carries the full fragment list. Add
characterization tests that pin the observable metadata costs, using the
built-in object-store IO tracker (same pattern as the lazy-column-metadata
tests):

- add one column to a 256-column dataset rewrites at least the previous
  manifest size of bytes;
- a cold open reads at least the manifest size even for a narrow query;
- after another writer commits, the next checkout_latest re-reads the
  full manifest even though the reader's projection did not change.

These document current behavior and are expected to be relaxed by any
future change that reduces metadata amplification (e.g. column-group
manifests).
@github-actions github-actions Bot added the chore label Sep 9, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Gate recommendation: approve with a non-blocking risk.

The read-side tests are isolated, fast, and directly characterize the full-manifest cost. The write-side characterization has a blind spot: total add_columns bytes include data and transaction files, so its threshold may stay green after the full-manifest rewrite is removed. Measuring the manifest object itself would make that assertion a durable signal.

// The commit rewrites the entire manifest, so it must write at least the
// previous manifest size (plus the transaction file and new data files).
assert!(
io.written_bytes >= base_manifest,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

io.written_bytes is operation-wide, not manifest-only, so this comparison does not establish that a full manifest was written. On this head, an instrumented run measured a 16,231-byte base manifest, a 16,859-byte new manifest, and 53,846 total bytes; subtracting the current manifest still leaves about 37 KB, already above base_manifest. The assertion can therefore remain green if a future implementation stops rewriting the full manifest—the exact improvement this test says should relax it. A manifest-path/size assertion (or the manifest writer’s reported size) would isolate the intended cost.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant