spec-7.4 D4: commit-latency histogram + BOC event/sweep observability - #41
Merged
Conversation
added 3 commits
July 11, 2026 19:08
… dump
Fold a per-commit-component microsecond latency histogram into the xnode
profile substrate so the p99 tail of each commit-decomposition bucket is
visible, not just the {total_nanos, n_events} mean. cluster_xp_end
classifies the sample delta into a us log bucket (edges 20/50/100/200/500/
1000/2000/5000/10000/20000/50000, half-open [lo,hi), top overflow) for the
five commit buckets (undo-flush / itl-stamp / tt-stamp / wal-flush /
scn-commit-advance); non-commit buckets stay byte-identical, and the whole
path stays behind the cluster.xnode_profile GUC (zero cost when off, so the
commit critical path keeps no new wait).
pg_cluster_state gains 60 hist.<component>.le_<edge>us keys (no new SRF, no
catversion bump; the SQL surface is the existing xnode_profile category).
Unit: test_cluster_xnode_profile U9 (bucket classify) / U10 (observe via
cluster_xp_end, non-commit buckets untouched, abort discards) / U11 (label +
edge schema) + U3 (reset zeroes the histogram) + U5 (dump-key formula
61 -> 121); test_cluster_debug histogram-label stubs; t/334 baseline 61 -> 121
plus a histogram-key existence leg.
Spec: spec-7.4-commit-scn-propagation-freshness.md (D4)
Add scn_boc_event_publish_count (bumped at the commit-event 0->1 dirty transition that wakes LMON) and scn_boc_sweep_fallback_count (bumped when the periodic sweep drain fires with no commit event pending -- the timer backstop covering a gap, or the event path off/suppressed). Their ratio reads how much the D1 event cadence carries vs the sweep fallback. Two atomic counters in ClusterScnSharedState + accessors; dump_scn emits scn_boc_event_publish_count / scn_boc_sweep_fallback_count (t/068 scn keys 28 -> 30). t/387 L1 asserts event_publish advances under the event path and L2 asserts sweep_fallback advances while event publish is suppressed. Spec: spec-7.4-commit-scn-propagation-freshness.md (D4)
clang-format-18 reflow of the D4 observability additions (histogram substrate + BOC event/sweep counters). Token-identical; check-format.sh reports 0 violations across all 543 cluster files. Spec: spec-7.4-commit-scn-propagation-freshness.md
sqlrush
pushed a commit
that referenced
this pull request
Jul 11, 2026
…use-#1 integration lane Main advanced past the PR #40 base (b015369) with spec-7.4 D0/D1/D4 (commit-scn freshness + durable frontier + BOC observability, PRs #39/#41), so the 5.22 integration branch no longer merged cleanly. Bring current main in and reconcile: - injection registry: both lanes added points (5.22: authority-block0-prove + 2 horizon + this branch's cluster-undo-authority-scan; 7.4: cluster-boc-event -publish), so the merged total is 169. Resolved the count assertions in t/015/017/018/020/021/022/023/024/030 to 169 (M5 derived 336 -> 338) and merged cluster-boc-event-publish into the t/015 sorted name list. - src/test/cluster_unit/Makefile SIMPLE_TESTS: union of both lanes' custom-rule test exclusions (5.22 undo tests + 7.4's test_cluster_scn_frontier). Verified on the merged tree: registry band t/015-030 + t/068 pass, 7.4's t/387 durable-frontier passes, both root-cause-#1 fixes (t/359_mxid, t/360) still pass, and cluster_unit is 175/175 clean.
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.
Summary
spec-7.4 D4 (observability) — promotes the D0 census commit-decomposition probes into resident instrumentation, plus BOC event-vs-sweep balance counters. No new SRF, no catversion bump; the default-off histogram path is byte-equivalent.
Changes
Commit-latency μs histogram (
5daa0c124c)cluster_xnode_profilegainshist[5][12]: 5 commit components (undo_flush/itl_stamp/tt_stamp/wal_flush/scn_commit_advance) × 12 buckets (11 edges 20…50000µs + overflow).cluster_xp_endclassifies + atomically increments inline; non-commit buckets are skipped (byte-equivalent, no new wait on the commit critical path).cluster.xnode_profilestays default-off → zero-cost off path.pg_cluster_statexnode_profile category gains 60hist.<component>.le_<edge>uskeys (no new SRF, no catversion bump).BOC event/sweep counters (
d92fbe1f5e)ClusterScnSharedState:boc_event_publish_count(event-path 0→1 transition) /boc_sweep_fallback_count(sweep fallback branch).dump_scnemitsscn_boc_event_publish_count/scn_boc_sweep_fallback_count.Test plan
Spec: spec-7.4-commit-scn-propagation-freshness.md