Skip to content

fix(ci): reduce OceanBase schema scans and isolate phase budgets - #2620

Open
hidb4ai wants to merge 1 commit into
oceanbase:masterfrom
hidb4ai:codex/oceanbase-ci-phase-budgets
Open

hidb4ai wants to merge 1 commit into
oceanbase:masterfrom
hidb4ai:codex/oceanbase-ci-phase-budgets

Conversation

@hidb4ai

@hidb4ai hidb4ai commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Related failure run: OceanBase nightly CI.

Rationale for this change

The nightly run failed in three different phases: a background CLI exceeded its startup deadline, a passing concurrent-startup case exhausted its process budget during database cleanup, and the native metrics CLI exceeded its 360-second migration deadline. Repeated full-schema reflection adds work to initialization, while workflow-level diagnostics arrive too late for an inner CLI timeout.

What changes are included in this PR?

  • Reuse unchanged table definitions within a maintenance revision for known single-table DDL. Re-read object names, views, triggers and vector declarations; fall back to full reflection for conditional operations, renames and unknown scopes. Keep full checks at revision entry, before domain writes/version advancement, after commit and on recovery. The stopped-writer maintenance contract still applies.
  • Reuse the layout just checked on the same OceanBase startup connection while retaining live-data, restore-state and embedding-profile admission checks. Independent profile opens continue to validate independently.
  • Give isolated background-listener cases initialization/execution/cleanup budgets of 420/120/60 seconds and concurrent-startup cases 300/120/60 seconds, plus a separate 60-second collection/import window. Align the background CLI cold-start limit with the existing 90-second native metrics limit. Keep native CLI plan/apply limits at 180/360 seconds. Reserve the corresponding step/job ceilings for cleanup.
  • Capture signal-triggered Python stacks and bounded container/session/lock/transaction snapshots before inner deadlines, preserve CLI JSON stdout, and terminate owned CLI process groups on timeout or cancellation. Upload diagnostics with the existing artifacts; failures, missing results and failed cleanup remain failures, with no automatic retries.
  • Classify the new helpers in CI path selection and update bilingual documentation and the persistence compatibility review.

Are there any user-facing changes?

OceanBase initialization and startup perform fewer redundant metadata reads. Public APIs, registered database layouts, frozen migrations, persisted formats and the required upgrade matrix are unchanged. Schema drift on an unrelated table during maintenance is still rejected before domain writes or version advancement; concurrent external schema changes remain outside the maintenance contract.

How was this change tested?

  • make check: passed, including hooks, type checks, lock/release checks and 61 integration-manifest tests.
  • python -m pytest tests/test_oceanbase_ci.py -q: 41 passed, covering separate phase deadlines, pre-timeout stacks, exit cleanup and cancellation of descendants. The six affected cases also passed after the final type-annotation adjustments.
  • python -m pytest tests/test_ci_changes.py -q: 154 passed.
  • Focused migration-schema, admission, historical-data and lifecycle regressions passed. Disabled native configurations were left skipped and are not claimed as accepted.
  • Real OceanBase, using the CI image ghcr.io/oceanbase/oceanbase-ce:4.3.5.6-106000012026040916 and capacity settings: all three original failing cases passed without skips, including database cleanup. The native CLI apply completed in 199.81 seconds under its unchanged 360-second limit.
  • Real OceanBase recovery after committed partial DDL and rejection of unrelated schema drift: both passed. Unfinished restore, damaged managed constraints and embedding-profile mismatch still reject admission. All seven diagnostic probes completed successfully against the real container.

A single sequential baseline/candidate measurement on the same host and container, with separate fresh databases, reduced runner.apply from 346.907 to 185.701 seconds and SHOW CREATE TABLE calls from 9,197 to 3,974. Counts for other statement categories were unchanged. This measures migration only, excluding imports, database creation, planning, cleanup and complete service startup.

The local Python minor versions match CI, but patch versions and machine load differ. These measurements do not establish GitHub runner or queue-time savings. The candidate's full GitHub workflow and all 12 installed-release upgrade combinations have not been run.

AI usage statement

Implemented and validated with OpenAI Codex, including code review and local native-backend probes.

This branch has not been deployed

No deployments
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