Skip to content

Prove native transactional table capabilities - #403

Merged
chubes4 merged 7 commits into
mainfrom
fix/mdi-377-capability-adapter
Sep 11, 2026
Merged

Prove native transactional table capabilities#403
chubes4 merged 7 commits into
mainfrom
fix/mdi-377-capability-adapter

Conversation

@chubes4

@chubes4 chubes4 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #393 for #377. Provide the transaction guarantees needed by identity reservation before advertising a backend capability.

The maintainer approved the capability as a backend-neutral integration API. This is not a claim of unchanged-consumer MySQL implementation parity. The temporary scope separation is superseded; the API is restored at 34057b03e535a0324802030ebed1118b53023d2f, whose tree is identical to the tested dcfe6b4 tree.

Consumer adapter: Extra-Chill/data-machine#3485. Land this engine prerequisite first.

  • Admit native reads and writes under the canonical root lock; retain admission across explicit transactions, rollback and savepoints.
  • Prevent independent SQL readers from observing uncommitted JSON/Markdown changes, and refresh stale snapshots at subsequent admission even when the reader never waited.
  • Expose optional wpdb::supports_transactional_tables(array $tables): bool for exact table sets. Require recognized canonical providers, matching mutation runtimes, admitted roots and permanent registered tables. Reject unknown, shadowed, arbitrary-provider, outside-root and read-only configurations.
  • Reuse typed scalar evaluation for duplicate-key increments required by identity reservation.
  • Add independent-process transaction, crash recovery, reader visibility and advisory-lock conformance tests.

This is bounded coarse serialization, not MVCC, an InnoDB engine label or physical mysqli support. Existing five-second lock waits can return explicit contention failures. Direct filesystem writers bypassing native locking are outside this contract.

Verification

Tested MDI: dcfe6b467d9d509271204faa313fc0cefa35c444.
Companion Data Machine candidate: 4432c2433dbce2985654cc88f57dc3d5abc411f0.

Repo-native reproduction (PHP with process-control support for independent-process probes):

php tests/probe-native-identity-reservation-transaction.php
php tests/smoke-native-transaction-read-isolation.php
php tests/smoke-native-advisory-lock-processes.php
php tests/smoke-native-journal-ownership.php
php tests/smoke-native-wpdb-lifecycle.php
php tests/smoke-native-request-snapshot.php
php tests/smoke-native-table-upsert.php

Paired unmodified DME consumer suite, WordPress 7.1 / PHP 8.3, managed multisite PHPUnit with the shared WP-CLI bootstrap:

Backend Passed Failed/Error Skipped Total
Native, with companion consumer adapter 1040 4 9 1053
MySQL control, with the same consumer adapter 1046 0 7 1053

All 15 prior identity/upsert failure identities disappear. The four remaining failures require physical mysqli connections/handles. Dedicated Data Machine reservation tests also pass: 26 passed, 0 failed, 1 skipped / 27 on MySQL.

Operator-retained runs: transaction-capability-full-native-dcfe6b4-4432c243, transaction-capability-full-mysql-dcfe6b4-4432c243, and dm-post-identity-mysql-4432c243-dedicated. Each retains its recipe and full JUnit. These are operator artifacts, not publicly hosted links; the commands above reproduce this repository's conformance checks.

The pre-existing smoke-native-table-replace.php has two failures on both the merged baseline and isolation candidate; this PR does not claim to fix them. Full MySQL parity remains tracked in #377. No release or deployment is included.

AI Assistance

OpenAI GPT-6 Astra (openai/gpt-6-astra) via OpenCode investigated the requirements, implemented and reviewed the engine and capability changes through isolated agents, corrected cache and capability-boundary defects during review, and ran independent-process and paired native/MySQL validation under maintainer direction.

@chubes4 chubes4 changed the title Prove native transactional table capabilities Fix native transaction read isolation and scalar upserts Sep 11, 2026
@chubes4 chubes4 changed the title Fix native transaction read isolation and scalar upserts Prove native transactional table capabilities Sep 11, 2026
@chubes4
chubes4 merged commit d490722 into main Sep 11, 2026
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