@@ -1512,47 +1512,47 @@ func RecordPendingDropsCleanupError(ctx context.Context, database, environment,
15121512 )
15131513}
15141514
1515- // Check refresh recording sources for RecordCheckRefreshRecorded .
1515+ // Merge gate recording sources for RecordMergeGateRecorded .
15161516const (
1517- // CheckRefreshSourceDriveTail marks a request recorded inline by the
1517+ // MergeGateSourceDriveTail marks a request recorded inline by the
15181518 // operator drive tail that settled the apply.
1519- CheckRefreshSourceDriveTail = "drive_tail"
1520- // CheckRefreshSourceSweep marks a request recorded by the backstop sweep
1519+ MergeGateSourceDriveTail = "drive_tail"
1520+ // MergeGateSourceSweep marks a request recorded by the backstop sweep
15211521 // over recently completed applies.
1522- CheckRefreshSourceSweep = "sweep"
1523- // CheckRefreshSourceReleaseSweep marks a settle request backfilled by the
1522+ MergeGateSourceSweep = "sweep"
1523+ // MergeGateSourceReleaseSweep marks a settle request backfilled by the
15241524 // sweep over terminal applies whose preflight held sibling checks but
15251525 // whose settle was never recorded.
1526- CheckRefreshSourceReleaseSweep = "release_sweep"
1526+ MergeGateSourceReleaseSweep = "release_sweep"
15271527)
15281528
1529- // RecordCheckRefreshRecorded counts durable check refresh requests recorded
1529+ // RecordMergeGateRecorded counts durable merge gate requests recorded
15301530// when an apply settles to terminal success. A sustained "sweep" rate means
15311531// drive tails are failing to record — check the operator logs for the
15321532// recording error.
1533- func RecordCheckRefreshRecorded (ctx context.Context , database , environment , source string ) {
1534- addCounter (ctx , "schemabot.check_refresh .requests_recorded_total" ,
1535- "Total durable check refresh requests recorded for applies that settled to terminal success" , "{request}" ,
1533+ func RecordMergeGateRecorded (ctx context.Context , database , environment , source string ) {
1534+ addCounter (ctx , "schemabot.merge_gate .requests_recorded_total" ,
1535+ "Total durable merge gate requests recorded for applies that settled to terminal success" , "{request}" ,
15361536 attribute .String ("database" , database ),
15371537 EnvironmentAttribute (environment ),
15381538 attribute .String ("source" , source ),
15391539 )
15401540}
15411541
1542- // RecordCheckRefreshRecordFailure counts failures to record a durable check
1543- // refresh request for a completed apply. The backstop sweep retries the
1542+ // RecordMergeGateRecordFailure counts failures to record a durable merge
1543+ // gate request for a completed apply. The backstop sweep retries the
15441544// recording on its next pass, so a transient blip self-heals; a sustained rate
15451545// means storage writes are failing and sibling PR checks are going stale —
15461546// check the operator logs for the storage error.
1547- func RecordCheckRefreshRecordFailure (ctx context.Context , database , environment string ) {
1548- addCounter (ctx , "schemabot.check_refresh .record_failures_total" ,
1549- "Total failures to record a durable check refresh request for a completed apply" , "{failure}" ,
1547+ func RecordMergeGateRecordFailure (ctx context.Context , database , environment string ) {
1548+ addCounter (ctx , "schemabot.merge_gate .record_failures_total" ,
1549+ "Total failures to record a durable merge gate request for a completed apply" , "{failure}" ,
15501550 attribute .String ("database" , database ),
15511551 EnvironmentAttribute (environment ),
15521552 )
15531553}
15541554
1555- // RecordCheckRefreshPROutcome counts per-PR outcomes of check refresh fan-out.
1555+ // RecordMergeGatePROutcome counts per-PR outcomes of merge gate fan-out.
15561556// Outcomes:
15571557// - "refreshed": the PR's stored check state was re-planned against the
15581558// mutated target schema.
@@ -1568,41 +1568,41 @@ func RecordCheckRefreshRecordFailure(ctx context.Context, database, environment
15681568// - "skipped_superseded": a racing write (a synchronize that re-planned a
15691569// newer head, or an apply that claimed the row) landed first and is
15701570// authoritative; the refresh yielded to it.
1571- func RecordCheckRefreshPROutcome (ctx context.Context , repository , database , environment , outcome string ) {
1572- addCounter (ctx , "schemabot.check_refresh .pr_refreshes_total" ,
1573- "Total per-PR outcomes of check refresh fan-out after a target schema changed" , "{refresh}" ,
1571+ func RecordMergeGatePROutcome (ctx context.Context , repository , database , environment , outcome string ) {
1572+ addCounter (ctx , "schemabot.merge_gate .pr_refreshes_total" ,
1573+ "Total per-PR outcomes of merge gate fan-out after a target schema changed" , "{refresh}" ,
15741574 attribute .String ("repository" , repository ),
15751575 attribute .String ("database" , database ),
15761576 EnvironmentAttribute (environment ),
15771577 attribute .String ("outcome" , outcome ),
15781578 )
15791579}
15801580
1581- // RecordCheckRefreshEventOutcome counts terminal outcomes of driving one
1582- // durable check refresh request. Outcomes:
1581+ // RecordMergeGateEventOutcome counts terminal outcomes of driving one
1582+ // durable merge gate request. Outcomes:
15831583// - "completed": the fan-out refreshed (or safely skipped) every sibling PR.
15841584// - "failed_retrying": the fan-out failed and the request will be retried.
15851585// - "failed_terminal": the fan-out failed on its final attempt — sibling PR
15861586// stored checks for the target may remain stale until their PRs re-plan.
15871587// Check the server logs for the failing PR and re-plan it.
15881588// - "lease_lost": the drive lost its lease mid-fan-out; another driver
15891589// re-drives the request (re-planning the same PRs again is safe).
1590- func RecordCheckRefreshEventOutcome (ctx context.Context , database , environment , outcome string ) {
1591- addCounter (ctx , "schemabot.check_refresh .events_total" ,
1592- "Total terminal outcomes of driving durable check refresh requests" , "{event}" ,
1590+ func RecordMergeGateEventOutcome (ctx context.Context , database , environment , outcome string ) {
1591+ addCounter (ctx , "schemabot.merge_gate .events_total" ,
1592+ "Total terminal outcomes of driving durable merge gate requests" , "{event}" ,
15931593 attribute .String ("database" , database ),
15941594 EnvironmentAttribute (environment ),
15951595 attribute .String ("outcome" , outcome ),
15961596 )
15971597}
15981598
1599- // RecordCheckRefreshTerminatedStuck counts check refresh requests terminated
1599+ // RecordMergeGateTerminatedStuck counts merge gate requests terminated
16001600// by the stuck-processing sweep: rows wedged past the attempt cap with an
16011601// expired lease (a driver hard-killed on its final attempt). Each terminated
16021602// request means sibling PR stored checks for its target may remain stale —
16031603// find the request's target in the server logs and re-plan the affected PRs.
1604- func RecordCheckRefreshTerminatedStuck (ctx context.Context , terminated int64 ) {
1605- addCounterN (ctx , terminated , "schemabot.check_refresh .terminated_stuck_total" ,
1606- "Total check refresh requests terminated by the stuck-processing sweep" , "{request}" ,
1604+ func RecordMergeGateTerminatedStuck (ctx context.Context , terminated int64 ) {
1605+ addCounterN (ctx , terminated , "schemabot.merge_gate .terminated_stuck_total" ,
1606+ "Total merge gate requests terminated by the stuck-processing sweep" , "{request}" ,
16071607 )
16081608}
0 commit comments