JackieTien97 opened a new pull request, #18552:
URL: https://github.com/apache/iotdb/pull/18552

   ## 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.
   - `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.
   
   - [x] Self-reviewed.
   - [x] Added Apache license headers and comments explaining lifecycle/cleanup 
behavior.
   - [x] Added regression tests and CI coverage.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to