Skip to main content

PI task maintenance and recovery

tip

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​

MaterialRetainPurpose
Task and modelTask ID, connection mode, target database, filter rules, original model CSV, and actual switch settingsDetermine recovery scope and avoid confusing fixed models with automatic discovery rules.
Collection pathOriginal/candidate Xnodes, agents, Windows hosts, SDK/plugin versions, and actual identitiesConfirm that source permissions and dependencies remain valid after changing the execution location.
Execution stateA controlled preserved copy of the original taosX task data directory, backfill progress, and automatic discovery stateA task configuration export does not contain all runtime state.
Data boundariesMost recently verified source time for each test Point/attribute, downtime, and last target value/statusDefine 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​

SituationCheckDo not infer directly
The original task restarts on the original taosXOriginal data directory, model, discovered objects, subscriptions, and new valuesA successful restart covers all offline history.
Windows taosX-Agent reconnectsIt points to the intended taosX, plugin version and identity are unchanged, and actual Points are readableAn online agent means every Point subscription succeeded.
Execution moves to another XnodeCandidate node, agent connection, model, identity, and source path are all availableThe original node's automatic discovery state or checkpoint necessarily migrates.
Backfill is interruptedOriginal task identity, progress files, target boundaries, and available archivesExit 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 locationObserve firstConfirm independently
taosX/Xnode running the taskWhether the original task and subtasks move to an eligible node, and whether the required taosX-Agent connects to that nodeModel, discovery state, subscriptions, and target data after the move; avoid two PI tasks collecting the same scope simultaneously.
Windows collection host or taosX-AgentWhether the collection process, PI identity, and SDK recover, and whether taosX-Agent connects to the intended endpointCentral 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 AFWhether the same identity can read Points, attributes, and required history againWhether archives retain interruption data and real-time subscriptions recover; TCP connectivity does not mean application reads succeed.
Target database or write pathWrite errors, queued cache, remaining disk space, and target recoveryWhether 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.

  1. 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.
  2. 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.
  3. List discovered objects absent from the initial CSV separately. First confirm whether collection continues after takeover, then decide whether to expand the backfill model.
  4. 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​

  1. Use the actual Windows collection identity to read Meter_001_Voltage again, plus one Point or attribute discovered automatically at runtime.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
warning

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.