Skip to content

Add daemon and cleanup tools for IoTDB Edge - #18552

Merged
JackieTien97 merged 1 commit into
apache:masterfrom
JackieTien97:ty-edge-ops-scripts
Aug 31, 2026
Merged

Add daemon and cleanup tools for IoTDB Edge#18552
JackieTien97 merged 1 commit into
apache:masterfrom
JackieTien97:ty-edge-ops-scripts

Conversation

@JackieTien97

@JackieTien97 JackieTien97 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Description

Add Edge-specific replacements for the standalone node ops scripts excluded from the Edge distribution in #18538.

  • Add tools/ops/daemon-edge.sh to register iotdb-edge.service, optionally start it and enable startup at boot. Preserve the existing restart policy, limits and Java environment support, while using Type=forking and edge.pid to supervise the JVM launched by start-edge.sh.
  • Add tools/ops/destroy-edge.sh and tools/windows/ops/destroy-edge.bat to stop the merged process before removing local data. Cover the local destroy-all behavior and every configurable ConfigNode/DataNode directory handled by the old node cleanup scripts, including system/consensus/data/WAL/tracing/sync/receiver/sort directories, comma/semicolon-separated paths, and legacy configuration-file fallback.
  • Preserve interactive confirmation and provide -f for unattended cleanup. Propagate stop/deletion failures, validate cleanup targets before deleting anything, and preserve configuration and logs. On Unix, stop the matching systemd service first to prevent a restart during cleanup.
  • Add non-interactive -f handling and propagate PowerShell failures in stop-edge.bat.
  • Include the new scripts only in the Edge package, retaining executable permissions and the exclusion of standalone ops scripts.
  • Add cross-platform regression coverage to the existing Edge CI workflow.

Verification

  • python3 .github/scripts/test-edge-ops.py: 24 passed on macOS; the native Windows-only case is skipped locally. The same suite is wired into both Ubuntu and Windows CI.

  • Edge CI: Ubuntu ops regression tests (including systemd unit verification), native Windows ops regression tests, and the existing Windows launcher tests all passed.

  • bash -n and ShellCheck 0.11.0: passed for both new shell scripts.

  • mvn -B -ntp clean package -pl distribution -am -DskipTests: all 37 reactor modules passed.

  • Inspected the built ZIPs: all three new scripts are present in Edge with mode 0755 and identical to source, absent from all/DataNode/ConfigNode packages, and the removed standalone ops scripts remain absent from Edge.

  • Started the built Edge package with JDK 17 in an isolated temporary installation, using custom ConfigNode/DataNode directories and two absolute data directories outside the installation. Created, inserted, flushed and queried both tree-model and table-model data successfully. Ran the packaged destroy-edge.sh -f and verified JVM termination, PID-file removal, cleanup of default and configured directories, and preservation of configuration and logs.

  • Self-reviewed.

  • Added Apache license headers and comments explaining lifecycle/cleanup behavior.

  • Added regression tests and CI coverage.

@JackieTien97
JackieTien97 merged commit 8c50293 into apache:master Aug 31, 2026
39 checks passed
@JackieTien97
JackieTien97 deleted the ty-edge-ops-scripts branch August 31, 2026 10:09
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