Tablespace Files Survive, but MySQL Cannot Read Them?
Diagnosis and Native IMPORT Assistance
Scenario Description
Tablespace files survive, but direct extraction or native MySQL IMPORT eligibility is uncertain. A deleted file may also remain open in mysqld. Begin with read-only diagnosis, capture an open file when appropriate, then choose physical extraction or native IMPORT.
Possible Causes
- Original directories, definitions or tablespace identities are incomplete.
- A file was deleted while its process still holds the descriptor.
- Partitions, FULLTEXT, CFG/CFP or INSTANT impose separate conditions.
Challenges
Conventional recovery often requires complete files, a running instance or a usable backup. In these situations, choose a method based on the evidence that survives.
Common Errors and Symptoms
- - A file exists, but the instance cannot open its table.
- - Readable ranges and exact failure reasons must be assessed.
- - Native IMPORT eligibility is not yet established.
Why Traditional Methods Fail
- - Direct DISCARD/IMPORT changes the target environment.
- - Passing diagnosis does not guarantee startup or IMPORT success.
- - A captured live file does not establish cold whole-database consistency.
PDU Solution
PDU saves read-only diagnostic results, error locations and possible recovery methods. Capturing an open file on Linux does not close its source FD. IMPORT assistance only prepares independent copies and an operation manifest for review. Results from external execution must be recorded separately.
Recovery Principle
- Diagnose Read-only
- Preserve Source Copy
- Assess IMPORT Eligibility
- Prepare and Record Tasks
PDU Core Capabilities
- Diagnose IBD files, expected-file inventories and instance manifests separately.
- Retain original errors and file offsets.
- Capture confirmed PID/FD sources read-only.
- Assess IMPORT eligibility separately.
- Generate reviewable tasks and ordered phases.
- Record native results without automatic trial import.
Recovery Steps
- 1
Diagnose Original Files
Diagnosis retains original errors and offsets, distinguishing file extraction, missing definitions, sparse pages and rejected paths. Passing diagnosis neither guarantees a bootable instance nor replaces IMPORT eligibility assessment.
- 2
Capture Deleted Files That Remain Open
The incident engineer must confirm PID/FD. Linux capture copies read-only without closing the owner FD or stopping the source process. A live copy alone does not prove cold database consistency. Use a new capture-task directory.
- 3
Assess IMPORT Eligibility
Eligibility and preparation use a separate working copy, retaining source identity and operation evidence. Ordinary InnoDB, partitions, FULLTEXT, CFG/CFP and INSTANT each require their own eligibility conditions and profiles. Confirm definitions, tablespace layouts, keys and target versions before preparation.
- 4
Inspect Tasks and Record External Results
Phase names and native-result profiles must come from actual external execution records for this run. Record phases in the order of the task manifest. FULLTEXT uses its own flow including OPTIMIZE; do not skip intermediate phases. Preparation is not completed IMPORT, and phase registration does not trigger automatic trial imports.
Quick Command Examples
Preserve frozen sources and launch PDU outside them. Write configuration snippets to pdu.ini and execute PDU commands after startup. Replace example paths, versions, times and task identities with actual evidence.
# Diagnose Original Files
diagnose ibd /recovery-input/orders.ibd /recovery-input/diagnose.conf;
diagnose inventory /recovery-input/expected-files.manifest;
diagnose instance /recovery-input/instance.manifest;# Capture Deleted Files That Remain Open
capture fd <PID> <FD> /recovery-work/new-capture-task;# Assess IMPORT Eligibility
import qualify /recovery-input/orders.ibd /recovery-input/diagnose.conf /recovery-input/import.conf;
import prepare /recovery-input/orders.ibd /recovery-input/diagnose.conf /recovery-input/import.conf /recovery-work/new-import-task;# Inspect Tasks and Record External Results
import show /recovery-work/new-import-task;
import record /recovery-work/new-import-task <phase> /recovery-input/native-result.conf;Export Results
Diagnosis Reports
File ranges, missing evidence, original errors and offsets.
Captured Evidence
Read-only copies and source records in a new capture task.
IMPORT Tasks
Eligibility decisions, operation manifests and external phase results.
After export, record PDU’s native success and failure counts and original errors, retaining checkpoints. Resume uses native records and file metadata without rereading exported data or automatic trial import.
Prerequisites
- Use exact source versions and diagnosis/IMPORT profiles prepared by the engineer.
- Native DISCARD/IMPORT belongs to an explicitly chosen external flow; PDU prepares tasks and records results.
- Prepare a matching program, license and sufficient space. Keep original evidence read-only and place the PDU launch directory outside the sources.
Important Notes
- Confirm PID, FD and profiles at the incident site rather than copying examples.
- Preparation and executed IMPORT are different states; PDU does not execute DISCARD/IMPORT automatically.
- Each table layout requires its own eligibility conditions rather than one universal profile.