Skip to content

perf(data-machine): skip per-request AS group and identity-schema probes when verified - #3714

Merged
chubes4 merged 1 commit into
mainfrom
perf/3711-schema-probes
Oct 31, 2026
Merged

chubes4 merged 1 commit into
mainfrom
perf/3711-schema-probes

Conversation

@chubes4

@chubes4 chubes4 commented Oct 31, 2026

Copy link
Copy Markdown
Member

Refs #3711. Saves 7 queries per request on every site, measured on production events.extrachill.com (validate_schema = 5, ensureDataMachineGroup = 2).

Change

  • AS group probe: action_scheduler_init now calls the new GroupRegistrar::ensureDataMachineGroupIfStale().
    • It trusts a per-site confirmation (option datamachine_as_group_verified, a unix time) for VERIFY_TTL = 1 hour.
    • Only a confirmed or inserted group row is recorded.
    • ScopedDrainService still calls the live ensureDataMachineGroup() right before staking a group-scoped claim. That's where a missing group would actually hurt.
  • Post-identity reservation schema: datamachine_maybe_install_post_identity_reservations() now checks its version marker before running validate_schema().
    • To keep self-healing, PostIdentityReservations::log_failure() clears the marker on any error-level database failure, so the next request revalidates and repairs.
    • The failing write still fails closed, as before.
    • A missing marker with a valid table now records the marker without running a repair.
  • uninstall.php deletes the new option.

Deliberately not changed

QueueTuning still runs GroupRegistrar::tablesExist() live (4 queries). action-scheduler-multisite-smoke asserts that a schema which disappears unhooks the runner and dispatchers at the next action_scheduler_init, and caching would break that contract. The remaining cost could be cut to one SHOW TABLES LIKE query, but that means reworking the legacy multisite fixture, so I left it for a follow-up on #3711.

Tests

  • tests/action-scheduler-group-registration-smoke.php: new checks that:
    • the hook uses the gated entry;
    • a stale gate probes;
    • a fresh gate issues 0 queries;
    • an expired gate probes again;
    • an unconfirmed group is never recorded.
  • tests/setup-schema-runtime-smoke.php: checks that:
    • a verified marker skips validation and repair;
    • a cleared marker revalidates and repairs;
    • a valid table with a missing marker records the marker without repair.
  • Related smoke tests pass: AS multisite, flow-routines, drain, backpressure, batch-scheduler, await-step, fanout recovery, schedule reconciliation, and uninstall-tables. In a full sweep, the only other failures were also failing on main.

Provenance

I profiled production in Extra-Chill/extrachill#428. Homeboy cook routes were unavailable (Lab runner disconnected, Extra-Chill/homeboy#16819; local provider auth failed). Chubes explicitly authorized writing this directly, so it was written and verified outside Homeboy.

🤖 AI disclosure: written by Extra Chill Bot (an AI agent), authorized by Chubes.

@homeboy-ci

homeboy-ci Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Homeboy Results — data-machine-business

Review lint

✅ review lint — passed

Deep dive: homeboy review lint data-machine-business --changed-since f984278

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-business-review-lint-homeboy-__Extra-Chill_homeboy-action-Linux-php8.2-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-business-review-lint-homeboy-__Extra-Chill_homeboy-action-Linux-php8.2-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/41245632691
Tooling versions
  • Homeboy CLI: homeboy 0.438.2+f0264e66e4ed83fac77a1e2855c8492dbb620e01
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy
  • Extension revision: 7d5107945
  • Action: Extra-Chill/homeboy-action@v2

@homeboy-ci

homeboy-ci Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Homeboy Results — data-machine-events

Review lint

✅ review lint — passed

Deep dive: homeboy review lint data-machine-events --changed-since f984278

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-events-review-lint-homeboy-__Extra-Chill_homeboy-action-Linux-php8.2-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-events-review-lint-homeboy-__Extra-Chill_homeboy-action-Linux-php8.2-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/41245632554

Review test

⏳ review test — timed out

  • 9 passed

ℹ️ To run specific tests: homeboy review test data-machine-events -- --filter=TestName
ℹ️ Auto-fix lint issues: homeboy review lint data-machine-events --fix
ℹ️ Collect coverage: homeboy review test data-machine-events --coverage
ℹ️ Save test baseline: homeboy review test data-machine-events --baseline
ℹ️ Analyze failures: homeboy review test data-machine-events --analyze
ℹ️ Pass args to test runner: homeboy review test -- [args]
ℹ️ Full options: homeboy self docs commands/test

Timeout triage

  • Phase: test; elapsed/budget: 1567s / 1500s
  • Selected: unknown; counts: complete: 9 passed, 0 failed, 0 skipped of 9

npm warn install-scripts 4 packages have install scripts not yet covered by allowScripts: npm warn install-scripts @parcel/watcher@2.5.1 (install: node scripts/build-from-source.js) npm warn install-scripts core-js@3.47.0 (postinstall: node -e "try{require('./postinstall')}catch(e){}") npm warn install-scripts core-js-pure@3.47.0 (postinstall: node -e "try{require('./postinstall')}catch(e){}") npm warn install-scripts unrs-resolver@1.11.1 (postinstall: napi-postinstall unrs-r

Deep dive: homeboy review test data-machine-events

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-events-review-test-homeboy-__Extra-Chill_homeboy-action-Linux-php8.2-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-events-review-test-homeboy-__Extra-Chill_homeboy-action-Linux-php8.2-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/41245632554
Tooling versions
  • Homeboy CLI: homeboy 0.438.2+f0264e66e4ed83fac77a1e2855c8492dbb620e01
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy
  • Extension revision: 7d5107945
  • Action: Extra-Chill/homeboy-action@v2

@homeboy-ci

homeboy-ci Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Homeboy Results — data-machine-socials

Homeboy

{
"schema": "homeboy/command-result/v3",
"command": "review",
"success": false,
"exit_code": 1,
"status": "failed",
"summary": "Invalid argument 'working_tree': Review tests require a clean component checkout",
"diagnostics": {
"code": "validation.invalid_argument",
"message": "Invalid argument 'working_tree': Review tests require a clean component checkout",
"details": {
"field": "working_tree",
"problem": "Review tests require a clean component checkout",
"tried": [
"Dirty files: homeboy-observations/",
"For dirty changed-file review, run homeboy review --changed-only lint separately."
]
},
"failure_digest": {
"summary": "Invalid argument 'working_tree': Review tests require a clean component checkout"
}
}
}

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-socials-review-lint-review-test-homeboy-__Extra-Chill_homeboy-action-Linux-php8.2-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-socials-review-lint-review-test-homeboy-__Extra-Chill_homeboy-action-Linux-php8.2-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/41245632535
Tooling versions
  • Homeboy CLI: homeboy 0.438.2+f0264e66e4ed83fac77a1e2855c8492dbb620e01
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy
  • Extension revision: 7d5107945
  • Action: Extra-Chill/homeboy-action@v2

…bes when verified

Every request on every site re-proved two facts that rarely change:

- GroupRegistrar::ensureDataMachineGroup on action_scheduler_init ran SHOW
  TABLES plus a group lookup (2 queries). The init hook now calls
  ensureDataMachineGroupIfStale, which trusts a per-site confirmation for an
  hour. The claim path in ScopedDrainService still ensures the group live.
- datamachine_maybe_install_post_identity_reservations validated the
  reservation schema (5 queries) before checking its marker. It now trusts
  the marker; any reservation database error clears the marker, so a lost
  table is revalidated and repaired on the next request.

The Action Scheduler table probe in queue tuning stays live: the multisite
contract requires a schema that disappears to unhook the runner at the next
init.

Refs #3711
@chubes4
chubes4 force-pushed the perf/3711-schema-probes branch from 562ba31 to e8b7933 Compare October 31, 2026 21:52
@chubes4
chubes4 merged commit 0158814 into main Oct 31, 2026
34 of 35 checks passed
@chubes4
chubes4 deleted the perf/3711-schema-probes branch October 31, 2026 22:31
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