Skip to content

spec-7.4 D4: commit-latency histogram + BOC event/sweep observability - #41

Merged
sqlrush merged 3 commits into
mainfrom
spec-7.4-d4-observability
Jul 11, 2026
Merged

spec-7.4 D4: commit-latency histogram + BOC event/sweep observability#41
sqlrush merged 3 commits into
mainfrom
spec-7.4-d4-observability

Conversation

@sqlrush

@sqlrush sqlrush commented Jul 11, 2026

Copy link
Copy Markdown
Owner

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_profile gains hist[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_end classifies + atomically increments inline; non-commit buckets are skipped (byte-equivalent, no new wait on the commit critical path).
  • GUC cluster.xnode_profile stays default-off → zero-cost off path.
  • pg_cluster_state xnode_profile category gains 60 hist.<component>.le_<edge>us keys (no new SRF, no catversion bump).

BOC event/sweep counters (d92fbe1f5e)

  • Two atomic counters in ClusterScnSharedState: boc_event_publish_count (event-path 0→1 transition) / boc_sweep_fallback_count (sweep fallback branch).
  • dump_scn emits scn_boc_event_publish_count / scn_boc_sweep_fallback_count.

Test plan

  • cluster_unit: 169 binaries (clean cassert rebuild; stale-.o relink verified)
  • cluster_regress: 13/13
  • PG regression (enable-cluster): 219/219
  • cluster_tap: t/334 (xnode + 60 hist keys, GUC-off all-zero leg), t/068 (scn 30 keys), t/387 (commit durable frontier + 2 D4 counter assertions)
  • fast-gate CI green

Spec: spec-7.4-commit-scn-propagation-freshness.md

SqlRush 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
sqlrush merged commit fb28626 into main Jul 11, 2026
5 checks passed
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.
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