Skip to content

fix(query): count window result columns against memory limit (#761) - #764

Merged
adityamukho merged 1 commit into
v3from
fix/761-window-memory
Oct 26, 2026
Merged

adityamukho merged 1 commit into
v3from
fix/761-window-memory

Conversation

@adityamukho

Copy link
Copy Markdown
Collaborator

Summary

  • Charge each retained window result column's value slots and owned payload against query_memory_limit while the input values and output rows coexist.
  • Grow result-column vectors with try_reserve so allocation refusal returns QRY-012; release column charges as results become cells and on errors, rewind, or close.
  • Add regression coverage for two long-string windows, successful draining, and result-column allocation refusal.

Fixes #761.

Verification

  • cargo test --quiet on bench machine s1c44t88 (exit 0)
  • cargo clippy --all-features -- -D warnings on s1c44t88 (exit 0)
  • cargo fmt --check and git diff --check (exit 0)
  • Claude final diff review: no actionable findings; checked its two stated assumptions against Held::reserve and value_bytes.

Scope

This covers retained result columns in windows. The existing partition index, sorting scratch space, and user aggregate internals are outside this fix's scope.

@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.01493% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/query/datalog/aggregate.rs 96.42% 1 Missing ⚠️
src/query/engine/window.rs 97.43% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 82e32c4 into v3 Oct 26, 2026
19 checks passed
@adityamukho
adityamukho deleted the fix/761-window-memory branch October 26, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant