Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

delta consolidate reports a governor refusal as ENOMEM without the session denial flag

Open
#2,161 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@justinjoy is already working on this.

Since Oct 13, 2026.

  • #2165 by @justinjoy — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
c
Domain
backend

Research direction

Read wl_columnar_eval_delta_consolidate in wirelog/columnar/eval_delta.c and the linked pull request #2165 to see how the work is proceeding. The issue identifies refusals in col_rel_append_all and col_rel_prepare_replacement; inspect those paths and the untimestamped col_op_consolidate route. Done means both budget refusals report ENOSPC with the denial flag set, while allocator faults remain ENOMEM with the flag clear; cover both cases in tests/test_session.c.

Written by the indexing model from the issue text.

Description

Summary

wl_columnar_eval_delta_consolidate (wirelog/columnar/eval_delta.c) can return ENOMEM for a governor refusal without the session's memory_budget_denied flag, so the public facades report WIRELOG_ERR_MEMORY instead of WIRELOG_ERR_MEMORY_BUDGET. Found while fixing #2160 (the nonrecursive multiworker merge), whose plan ends in CONSOLIDATE; the merge itself is handled there, this is the consolidate step that runs after it.

Where

wl_columnar_eval_delta_consolidate builds a $consol candidate and replaces the target with it:

  • col_rel_append_all(candidate, target, NULL) (eval_delta.c ~1834): a refused growth returns ENOMEM with candidate->memory_budget_denial_pending set. The candidate is never in sess->rels, and wl_columnar_eval_stack_cleanup_finish(&frame) (~1899) destroys it, so neither the rc nor wl_columnar_session_budget_denied reports a denial.
  • col_rel_prepare_replacement(target, candidate, ...) (~1867): a refused reservation returns ENOMEM with target->memory_budget_denial_pending set. When the target is registered in sess->rels, wl_columnar_session_budget_denied sees the evidence, but the rc stays ENOMEM and wl_facade_session_error_code_with_budget (wirelog/extension_registry.c) returns WIRELOG_ERR_MEMORY_BUDGET only for ENOSPC. When the target is a temporary (eval.c final->rel, combined), the evidence is lost too.

Creating the candidate is already mapped (ENOSPC with the flag). The function has six callers (eval.c wl_columnar_eval_finalize_relation, wl_columnar_eval_nonrec_relation_parallel and tdd_global_read_exchange_deltas; eval_delta.c; eval_serial.c; eval_tdd_insert.c), so the mapping belongs inside it.

Reproduction (observable state only)

The #2160 test harness in tests/test_session.c (merge_denial_run), with the plan changed from VARIABLE(input) to VARIABLE(input), CONSOLIDATE and the budget left in place after phase boundary 4:

  • 2 workers, WIRELOG_NONREC_TDD_MIN_ROWS_PER_WORKER=64, 128 distinct timestamped INT64 input rows, output pre-registered with 1 timestamped row;
  • at phase boundary 3, the governor is set ENFORCING with usable_bytes = reserved + headroom;
  • headroom swept from 0 in 256-byte steps, with the #2160 fix applied.
headroom (bytes) phase 4 (merge done) phase 5 (consolidate done) step rc denial flag public code
0-13056 no no ENOSPC set WIRELOG_ERR_MEMORY_BUDGET
13312 yes no ENOSPC set WIRELOG_ERR_MEMORY_BUDGET
13568-27904 yes no ENOMEM clear WIRELOG_ERR_MEMORY
28160 yes yes 0 clear OK

With fprintf instrumentation (not needed for the reproduction above), the ENOMEM band splits into the candidate append (about 13504-21695) and prepare_replacement (about 21696-27967).

Expected

ENOSPC with sess->memory_budget_denied set for both refusals, so every caller reports a budget denial.

Suggested fix and test

  • Inside wl_columnar_eval_delta_consolidate, map each result while its relation is alive (ENOMEM plus the relation's memory_budget_denial_pending becomes ENOSPC; the candidate for the append, the target for prepare_replacement) and set sess->memory_budget_denied on ENOSPC, before the cleanup frame destroys the candidate.
  • Audit the branch for candidates without timestamps (the col_op_consolidate route), which this reproduction does not exercise.
  • Test both refusals with a searched headroom (as the #2160 test does), asserting ENOSPC, the flag and WIRELOG_ERR_MEMORY_BUDGET, and add an allocator-fault case that must stay ENOMEM with the flag clear.
Dominant language
C
Stars
18
Forks
2
Avg merge
8h
Merged PRs (30d)
287

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from semantic-reasoning/wirelog

All issues in semantic-reasoning/wirelog

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.