PI task maintenance and recovery
Before maintenance or failure recovery, preserve task configuration, runtime state, and data boundaries, then choose recovery on the original node or takeover by another node. This page uses Meter_001_Voltage to calculate the backfill window and distinguishes failures in the PI source, Windows collection path, taosX/Xnode, and target database.
Entry point: the taosExplorer task list, Xnode queries in its Data Browser or the taos CLI, and runtime checks on the actual taosX and Windows collection hosts.
Database replicas, task rescheduling, real-time compensation, and backfill from source archives are different recovery measures. They cannot replace one another.
1. Materials to retain before maintenance
| Material | Retain | Purpose |
|---|---|---|
| Task and model | Task ID, connection mode, target database, filter rules, original model CSV, and actual switch settings | Determine recovery scope and avoid confusing fixed models with automatic discovery rules. |
| Collection path | Original/candidate Xnodes, agents, Windows hosts, SDK/plugin versions, and actual identities | Confirm that source permissions and dependencies remain valid after changing the execution location. |
| Execution state | A controlled preserved copy of the original taosX task data directory, backfill progress, and automatic discovery state | A task configuration export does not contain all runtime state. |
| Data boundaries | Most recently verified source time for each test Point/attribute, downtime, and last target value/status | Define the recovery window and backfill scope. |
Redact configuration and logs before collection. Do not include private keys, passwords, or Tokens in diagnostic packages. For general steps, see Diagnostic packages and support tickets.
2. Determine the recovery path
| Situation | Check | Do not infer directly |
|---|---|---|
| The original task restarts on the original taosX | Original data directory, model, discovered objects, subscriptions, and new values | A successful restart covers all offline history. |
| Windows taosX-Agent reconnects | It points to the intended taosX, plugin version and identity are unchanged, and actual Points are readable | An online agent means every Point subscription succeeded. |
| Execution moves to another Xnode | Candidate node, agent connection, model, identity, and source path are all available | The original node's automatic discovery state or checkpoint necessarily migrates. |
| Backfill is interrupted | Original task identity, progress files, target boundaries, and available archives | Exit and retry never replay data, or a newly created task retains all progress. |
Automatic discovery state is not equivalent to the initial CSV. Objects added at runtime may not be written back to the initial file. Recovery with state retained on the same node does not prove that another node or shared storage can recover the same scope. Before cross-node takeover, compare discovered lists and target data using isolated objects. Reconfirm and backfill missing objects.
Follow Multi-node takeover and maintenance for registration, draining, and maintenance of multiple Xnodes. This does not justify a promise of fixed 10–30 second recovery or uninterrupted collection during switchover. When using shared storage, also verify state and data against the actual PI topology.
2.1 Failure impact scope
| Interruption location | Observe first | Confirm independently |
|---|---|---|
| taosX/Xnode running the task | Whether the original task and subtasks move to an eligible node, and whether the required taosX-Agent connects to that node | Model, discovery state, subscriptions, and target data after the move; avoid two PI tasks collecting the same scope simultaneously. |
| Windows collection host or taosX-Agent | Whether the collection process, PI identity, and SDK recover, and whether taosX-Agent connects to the intended endpoint | Central taosX redundancy does not replace Windows collection host redundancy and cannot collect all data that was not received at the time. |
| PI Data Archive or AF | Whether the same identity can read Points, attributes, and required history again | Whether archives retain interruption data and real-time subscriptions recover; TCP connectivity does not mean application reads succeed. |
| Target database or write path | Write errors, queued cache, remaining disk space, and target recovery | Whether collected data is successfully written later; an online PI subscription does not prove complete ingestion. |
After the collection process exits, PI real-time subscriptions must be reestablished. Subscription recovery only resumes receiving changes; it does not automatically reconstruct interruption history of arbitrary length. Saved automatic discovery state is not a durable consumption position for each real-time event either.
3. Determine the range requiring backfill
Record the last verified source event time, failure start time, new collection process recovery time, and actual Restart Compensation Time. Compensation looks back from recovery time; it does not fill forward from failure start or the last target record.
For example, the last verified source event for Meter_001_Voltage is at 10:00, the collection process recovers at 10:20, and compensation is set to 5 minutes:
最后已核对的源事件:10:00
采集进程恢复:10:20
补偿设置:5 分钟
先检查自动补偿:约 10:15 至 10:20
另安排受控 backfill:10:00 至 10:15
Use the same explicit time zone throughout. This example only explains window calculation. It does not guarantee that boundary records exist, that compensation covers exactly five full minutes, or that ranges outside those shown need no checks.
- Query this Point's archives at the PI source using the original identity. Confirm that records remain readable. Do not substitute interpolated trend points for actual archived events.
- Query the target in segments using the same Point, timestamp precision, and value/status. Distinguish no source events, missing target writes, quality filtering, and overlapping updates.
- List discovered objects absent from the initial CSV separately. First confirm whether collection continues after takeover, then decide whether to expand the backfill model.
- For remaining gaps, create bounded backfill as described in PI historical backfill and real-time continuation. Check gaps and boundaries after completion.
Simply increasing the compensation window does not guarantee recovery of all live values, Snapshot updates, or out-of-order late values. Events not retained in source archives cannot be reconstructed through backfill. Historical changes earlier than the actual compensation range must not be considered synchronized merely because the task is running again.
4. Checks after recovery
- Use the actual Windows collection identity to read
Meter_001_Voltageagain, plus one Point or attribute discovered automatically at runtime. - In addition to checking that the task shows Running, query the corresponding target child tables. Confirm that new values continue to arrive and that times, values, and status match the source.
- Check gaps against the downtime window and finite compensation range. Create separate bounded backfill for data outside the window, late history, or objects whose state was not restored.
- When backfill and real-time data overlap, confirm the target model, primary-key precision, and update results. Compare by Point or attribute, not only total row count.
- Retain detection time, recovery time, gaps, and final comparison results as records of the site recovery exercise. Do not generalize takeover latency from other environments into an SLA.
Do not clear task directories, delete target tables, disable all agents, or start two tasks with the same scope merely to test recovery. If dependencies and state cannot be confirmed, preserve the environment and contact support first.