Skip to content

feat(python): expose frozen memtable metrics in memtable_stats - #8526

Merged
hamersaw merged 1 commit into
lance-format:mainfrom
hamersaw:feature/wal-py-frozen-metrics
Aug 14, 2026
Merged

feat(python): expose frozen memtable metrics in memtable_stats#8526
hamersaw merged 1 commit into
lance-format:mainfrom
hamersaw:feature/wal-py-frozen-metrics

Conversation

@hamersaw

Copy link
Copy Markdown
Contributor

MemTableStats already tracks frozen_count and frozen_bytes, but the Python binding dropped them on the way out. This adds both keys to the dict returned by ShardWriter.memtable_stats().

  • frozen_count — frozen memtables in the read view: sealed-awaiting-flush, plus flushed ones still inside frozen_memtable_grace.
  • frozen_bytes — heap bytes still owed to flush. Together with the active memtable's estimated_size_bytes, this approximates what backpressure meters against max_unflushed_memtable_bytes.

Testing

Extends the closed-writer stats assertions in test_mem_wal.py to cover both keys. Not run locally — no built extension in this worktree, so CI is the first execution.

🤖 Generated with Claude Code

Surface the `frozen_count` and `frozen_bytes` fields of `MemTableStats`
through the Python binding so callers can observe how much heap is still
owed to flush without reaching into Rust.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added A-python Python bindings enhancement New feature or request labels Aug 13, 2026
@hamersaw
hamersaw marked this pull request as ready for review August 13, 2026 20:54

@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.

The Python binding now forwards the existing Rust frozen-memtable metrics directly, preserving their established semantics while exposing the missing operational visibility.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 13, 2026
@hamersaw
hamersaw merged commit 706b941 into lance-format:main Aug 14, 2026
18 checks passed
@hamersaw
hamersaw deleted the feature/wal-py-frozen-metrics branch August 14, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-python Python bindings enhancement New feature or request K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants