Restarts, checkpoints, and store-and-forward
Maintenance restarts and interruption recovery for taosX and collection agents include preserving state before restarting and checking data afterward. The key is not whether the service restarts successfully, but whether data in the interruption window can be accounted for. Without persistence enabled, in-memory data is not recovered.
Where to operate: tasks and advanced options in taosExplorer; service management on taosX or taosX-Agent hosts; run SQL in the taosExplorer Data Browser or taos CLI.
Connectors differ in reread capabilities and progress persistence. There is no universal resumption guarantee.
Use the following checks to resume tasks and replay interruption-period data. For replay from database backups, see Backup and restore. See Multi-node takeover and maintenance for multi-node reassignment and agent endpoint maintenance. A change of execution node does not mean original state has been copied.
1. Distinguish recovery materials
| Material or mechanism | Purpose | Operational considerations |
|---|---|---|
| Source consumer positions or read progress | Determine the next read position | Depend on source retention and connector semantics; changing consumer groups may change the starting point |
| taosX-Agent store-and-forward | Save data received by the agent but not acknowledged as delivered | Requires prior activation, available disk, and original cache state |
| Target connection error cache | Cache data awaiting rewrite according to task error policy | Check configuration and the node holding the cache; do not assume it is enabled by default |
| Error data archive | Save some failed samples for analysis | Not a complete failed dataset or an automatic backfill mechanism |
| Raw-data retention | Retain raw source records in supported tasks | Limited by activation, directory, and connector retention rules; not an automatic resumption checkpoint |
| Database backup | Restore protected database data | Not a task export or any cache above; restore and verify independently |
Do not resolve ordinary connection errors by clearing task directories, deleting checkpoints, or switching to a new consumer group. These actions may lose pending replay data or change the read scope.
Without persistent agent store-and-forward enabled, unacknowledged in-memory data cannot be recovered by restarting the agent. The sending window is not a disk queue. Even with persistence enabled, preserve the original cache directory and meet the supported-source and recovery conditions below.
Before recovery, answer three questions: can the source reread interruption-period data; which host holds data already collected but not written; and which records prove complete recovery? If any answer is unknown, save configuration, directory inventories, and source/target boundaries first. Do not clean up or move files directly.
For example, record committed positions and retention ranges for each Kafka partition. For OPC polling tasks, record points, source timestamps, and agent cache status. Do not apply the same assumption of automatic post-restart backfill to both. Existing materials are not necessarily usable; confirm directory readability and unexpired source data before recovery.
2. Planned restart order
- Record task configuration, source progress, the last verified target position, agent cache directories, and free disk space.
- Confirm that source retention covers maintenance and catch-up. For real-time sources without replay, assess interruption impact first.
- Stop tasks or services according to maintenance scope. Preserve original task definitions and recovery state and caches on taosX and taosX-Agent hosts.
- After restoring networks, source, target, and required components, check Xnode, agent, and task states. Explicitly start tasks that should run but do not.
- Check consecutive periods before, during, and after downtime. Confirm that pending data decreases and real-time lag recovers, and identify missing and duplicate records.
RESTART XNODE restarts the management daemon, not the taosx data process. Maintain taosX or taosX-Agent services on the hosts where those services run to avoid restarting the wrong component.
Before restarting a system service, finish the records above and confirm the maintenance window. Handle containers and other startup methods using the original deployment method; do not mix service management commands.
After restart, check in order: service started, Xnode/agent recovered, original task in expected state, and new samples ingested. If any step fails, check that component's logs instead of repeatedly restarting.
- Linux
- Windows
2.1 Check and restart Linux systemd services
This section applies only to package-installed services managed by systemd. Run on the actual Linux service host. Perform read-only checks first; do not use the restart command below as a health probe:
systemctl status taosx --no-pager --full
systemctl show taosx -p FragmentPath -p ExecStart -p User -p MainPID
status shows current state and recent service messages. A nonzero exit code when the service is not running is a state to investigate. show displays the unit file location, startup command, configured service account, and main process PID. If User is empty, a systemd system service usually uses root by default. Compare this with deployment records; it does not mean the service has no account. Use ExecStart to check the actual program and explicit startup arguments. If no configuration path is explicit, confirm its source against the original deployment records rather than assuming /etc/taos/taosx.toml.
If MainPID is 0, systemd currently reports no main process. Check service state first; do not pass 0 to subsequent process sampling commands. When running, use the real PID to check the actual account and startup command using Tuning and resource control, rather than relying only on configuration fields.
If the service unit is missing, confirm the host, actual unit name, and deployment method first. Do not temporarily create another service. To inspect taosX-Agent, replace unit name taosx with taosx-agent on the agent host; its default configuration is /etc/taos/agent.toml. Do not restart other components just to maintain one.
After recording recovery materials, confirming interruption impact, and obtaining approval for the maintenance window, have an administrator with service management permissions restart the relevant service. For taosX:
sudo systemctl restart taosx
sudo requires authorization and is unnecessary in an already authorized root session. A successful response means only that systemd completed this operation. Then check:
systemctl is-active taosx
systemctl status taosx --no-pager --full
journalctl -u taosx --since '10 minutes ago' --no-pager
is-active output of active with exit code 0 confirms service activity, not task recovery. If it shows failed, inactive, or repeated restarts, retain status, journal, and file logs first and investigate the startup error. Once stable, continue the node, agent, task, and data verification on this page. See Logs and performance for log permissions and file locations.
Open the Services manager on the actual Windows service host and find the taosx or taosx-agent service to maintain. Check its executable path, logon account, and dependencies in Properties first, then have an administrator with service management permissions restart that service. Use actual names for custom services; do not restart other components at the same time.
After the service returns to Running, check the component logs, then complete node, agent, task, and data verification on this page. If it cannot start or repeatedly stops, retain service errors and application logs and investigate startup failure. Do not repeatedly restart or recreate business tasks instead of recovering them.
3. Check recovery starting points by source
| Task | Before recovery | After recovery |
|---|---|---|
| Kafka ingestion | Original consumer group, committed positions, message retention, and starting-point settings when no committed position exists | Check target data against topic, partition, and message identifiers; confirm backlog decreases rather than substituting restored connectivity for data checks |
| TMQ one-way synchronization | Actual topic, consumer group, each vgroup position, source history and WAL retention; do not assume an automatic group name stays unchanged after connection changes | Check target structures, timestamps, values, and tags across the interruption; commit counts do not replace saved positions or data verification. Check idle timeout for continuous operation. See Continuous TMQ synchronization; delete-propagation restrictions still apply |
| Pulsar and Tuya | Original topics, subscriptions, source retention, and other consumers of the same subscription; for Tuya, also check the Access identity and production/test environment | Check target data against actual events before, during, and after interruption. A standby Failover consumer may not actively read. Do not delete subscriptions or use seek_to_end to fix missing data. See Pulsar |
| MQTT ingestion | Original Client ID, clean-session setting, broker-accepted session lifetime, QoS, and real-time cache; MQTT 5.0 requests a 60-second session expiry when clean session is disabled | Check whether the server still has the original session and verify the interruption window by message identifier; restarting cannot recover expired sessions or data never received |
| OPC UA and OPC DA real-time collection | Whether the source provides required history and agent store-and-forward was enabled beforehand | Check cached data replay by point and time range; caches cannot recover point values never collected |
| PI historical backfill | Original points, time range, progress, and existing target data | Check PI historical records interval by interval and backfill small scopes if necessary; do not assume every interruption resumes without duplicates |
Standalone TDengine query migration (taosx run) | Original command, objects, time window, and target range already written | Check intervals before deciding to rerun or backfill in segments; do not assume service-task checkpoints are inherited |
| Dual-active task | Original task and committed positions, and source database WAL retention range | Check the interruption window and catch-up progress; if outside the resumable range, follow the dual-active plan |
When a dual-active task stops, it commits positions for data successfully written to the target, and resumes from those positions on the next start. Source data must still be readable. See the Dual-active solution for complete conditions. Do not generalize this behavior to all ordinary tasks.
3.1 Recovery entry points for other sources
The table below provides recovery navigation for service tasks. Preserve the original task, configuration, and execution-host state before following the relevant section. It adds no universal resumption guarantee for these sources. Standalone taosx run commands still require checks against the original command and corresponding page; using the same source does not inherit service-task progress.
| Source | Dedicated entry | Preserve and check first |
|---|---|---|
| MySQL, Oracle, PostgreSQL, SQL Server queries | Relational database recovery and troubleshooting | Original task, SQL template, verified windows, and actual read position; recheck late and downtime data; queries are not log-based CDC. |
| MongoDB template queries | MongoDB troubleshooting, recovery, and limitations | Original collection, time field, and state; review the interruption window; this is not Change Stream replication of all changes. |
| InfluxDB | InfluxDB stop, recovery, and limitations | Progress files, configuration, Measurement/tag set, and target mapping; separately protect late historical data and new writes during cutover. |
| OpenTSDB | OpenTSDB stop, recovery, and limitations | Metrics, windows, naming, and original progress; do not manually edit breakpoints to skip backlog. |
| CSV upload or directory watching | CSV troubleshooting and recovery | Input copies, processed-file inventory, and watch paths; interruption, replacing a same-name file, or recreating a task may cause rereads. |
| AVEVA history and Live | AVEVA stop, recovery, and limitations | Original task, mapping, and verified boundaries; check historical windows and Live new values separately; uncollected intermediate Live changes are not guaranteed to be recovered. |
| Sparkplug B | Sparkplug B stop, recovery, and limitations | Original configuration, Birth/alias, and actual new values; MQTT reconnection does not replace metric mapping verification. |
4. Enable taosX-Agent store-and-forward
taosX-Agent provides agent store-and-forward for OPC UA, OPC DA, and MQTT real-time collection tasks. Enable it in the task's advanced options; installing the agent alone does not enable it.
| Setting | What to confirm |
|---|---|
persist_data_enable | Default false; enable explicitly when real-time data caching is needed |
persist_data_dir | Use a writable disk on the collection agent with enough space; defaults to persist_queue under the task data directory |
4.1 Configure and confirm activation
- Find the OPC UA, OPC DA, or MQTT real-time task in taosExplorer and confirm that it actually selects taosX-Agent rather than direct collection.
- Save the original configuration and enable Cache Real-Time Data in advanced options. For a custom directory, set Cached Data Storage Directory. This path belongs to the actual agent host, not taosX or the browser host.
- Confirm that the service account has read/write access on the agent host, and record free disk space and existing directory contents. Do not mix the directory with diagnostic output or delete an existing queue to “initialize” it.
- Save and restart the original task under the configuration change procedure. Send an identifiable test message or point change and check the target. Also check agent logs for directory, permission, or cache initialization errors.
4.2 Drill disconnection and replay in isolation
Use only dedicated test tasks and approved network scope. Do not arbitrarily disable network adapters or block all ports on production hosts.
| Stage | Action | Results to record |
|---|---|---|
| Before disconnecting | Select a test point or message identifier and check source, target, and collection time | Task is normal and samples can be ingested; record the last target position |
| During disconnection | Interrupt only the test agent-to-taosX path; keep source-to-agent collection and the agent process running | Source keeps changing; agent logs, queue files, and usage show undelivered data is retained |
| After restoration | Restore original network conditions and observe the original task; do not create a replacement | Samples received by the agent during interruption appear in the target, backlog gradually decreases, and new data keeps arriving |
| Verification | Check records before, during, and after interruption by point/message identifier | Explain missing data, replay, and catch-up time; an agent returning online alone does not establish success |
When inspecting directories, record file counts, total size, and modification times. Files not shrinking immediately do not alone establish replay failure; the product cleans up files according to delivery state. Verify target samples, undelivered scope, and logs together. If space usage keeps growing, recheck whether downstream systems have truly recovered.
Caches protect only data already received by the agent. Data not received because source-to-agent collection disconnected or the agent stopped collecting does not automatically enter the cache. Sudden power loss or disk failure may also lose recent data not yet synchronized to disk.
If the target has written data but the acknowledgment does not return, the agent may resend the same batch. Check results by primary key and business identifier; no-duplicate delivery is not guaranteed. With an error-archive policy, batch processing completion may include handling failed data and does not mean every row was ingested.
Authentication, configuration, or version problems may stop tasks. After fixing them, start the original task and preserve unacknowledged caches. Under excessive disk pressure, restore downstream systems, expand capacity, or reduce source load first. Do not delete queue files directly. See taosX-Agent store-and-forward for configuration and recovery boundaries.
5. Node changes and recovery verification
Before taking over tasks on another Xnode, check its source/target networks, plugins, certificates, files, and directory permissions. Scheduling records alone do not establish that files and caches on the original execution node have moved. With only one available Xnode, draining cannot provide uninterrupted maintenance either.
Verification must at least confirm that the original task resumes on the intended node, source read positions are explainable, interruption-window counts and samples are checked, caches or backlog subside within an acceptable time, and new data keeps reaching the target. If source data has expired or recovery state on the execution host is damaged, preserve existing evidence before preparing a backfill plan.
Before ending maintenance, record verification results for each period:
| Scope | Source evidence | Target verification | Unresolved items |
|---|---|---|---|
| Last period before interruption | Point timestamps, message positions, or historical ranges | Corresponding records still exist with correct values and tags | Any in-flight or duplicate records |
| During interruption | Rereadable scope or inventory of samples received by the agent | Backfilled scope, count definitions, and sample results | Scope never collected, expired, or missing from caches |
| New data after recovery | New identifiable records and generation times | Continuously queryable with lag meeting business requirements | Any remaining errors and backlog |
Explicitly report unrecoverable ranges to the business owner and support. Do not conceal gaps by deleting old records, resetting positions, or clearing queues.