release: return processed grains from rollups - #194
Merged
Conversation
samo-agent
approved these changes
Jul 27, 2026
samo-agent
left a comment
Contributor
There was a problem hiding this comment.
Verified on exact rebased head 717545e. Issue #191 is reproducibly RED on main (one processed grain with two datids returns 2) and GREEN here (returns 1 while preserving two physical rows and 60/3600-second watermark movement). The exact added contract covers one/two datids, empty grains, and caught-up zero-work. The complete #185/#162 rotation regression passes. Independent static review found no blocker, and composing this fix with #192 makes all four feature-bearing surfaces pass on both PG17 and PG14 (8/8). Migration wording was corrected to describe the intentional return-value change without claiming all lifecycle behavior is unchanged. APPROVED.
NikolayS
marked this pull request as ready for review
July 27, 2026 22:27
samo-agent
added a commit
to samo-agent/pg_ash
that referenced
this pull request
Jul 27, 2026
NikolayS#194 deliberately changed rollup_minute() from counting inserted database rows to counting every processed completed minute. The NikolayS#136 fixture starts twenty minutes in the past, so its unbounded setup call now correctly returns roughly twenty rather than the stale expected value 1. Limit that setup call to one grain and describe the assertion as one completed minute. The expected value remains 1 and every compacted-attribution assertion is unchanged. NikolayS#194 already records the return-contract change in RELEASE_NOTES.md.
NikolayS
added a commit
that referenced
this pull request
Jul 27, 2026
* test: expose compacted query attribution gaps * fix: keep compacted query attribution honest * docs: explain compacted query attribution * test: bound query-attribution rollup setup #194 deliberately changed rollup_minute() from counting inserted database rows to counting every processed completed minute. The #136 fixture starts twenty minutes in the past, so its unbounded setup call now correctly returns roughly twenty rather than the stale expected value 1. Limit that setup call to one grain and describe the assertion as one completed minute. The expected value remains 1 and every compacted-attribution assertion is unchanged. #194 already records the return-contract change in RELEASE_NOTES.md. * test: verify rebased query-attribution interactions * ci: trigger rebased pull-request verification * ci: keep query-attribution gate runnable GitHub Actions rejects workflow files above 512,000 bytes before creating a run. The #136 inline SQL raised test.yml from 506,109 to 535,600 bytes, which left #198 with no check suite. Move that exact 749-line payload to devel/tests/query_attribution_assert.sql and invoke it with psql -f; the SQL is byte-identical after removing YAML indentation and every assertion remains unchanged. The workflow is now 506,353 bytes. --------- Co-authored-by: samo-agent <280144521+samo-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #191.
Unblocks #192.
Contract decision
ash.rollup_minute(integer)andash.rollup_hour()now return the number of completed time grains processed, independent of how many(grain, datid)rows are upserted. This matches their catalog comments, the batch-limit model, and the operator-visible meaning of catch-up progress.Each completed loop iteration counts once, including an empty grain: it consumes one batch slot and advances its watermark. A call with an already-caught-up watermark still returns exactly
0because it processes no loop iterations.Changes
ROW_COUNTrollup_minute(1000000)RELEASE_NOTES.mdCall-site audit
ash.rotate()stores the minute-rollup result but never reads or compares it. Exceptions and its independent(minute, datid)completeness query remain authoritative, so release: prevent cleanup from deadlocking rotation #185's truncation safety is unchanged.ash.rollup_cleanup()does not consume either return value; it only shares the rollup advisory lock and continues returning physical deletion counts.ash.status()does not call either rollup function; it reports physical table rows and watermarks directly.SELECTstatements and do not branch on the scalar.0on no-work/busy/incomplete paths, assert> 0, or assert1for a single grain/database. Those expectations remain valid. PR release: add behavioral feature-gate coverage #192's retained two-database assertion changes from RED to GREEN.Validation
After the required hand rebase onto main
3af54a7:2for one minute/hour grain1, and watermarks advance by 60/3600 seconds0git diff --check: PASSThe migration header was also corrected during rebase so it no longer broadly claims all admin/lifecycle functions are unchanged while documenting this intentional return-value correction.