Hi all,

I'd like to share a new pull request that improves how we handle resource
cleanup and thread safety in the DataNode service.

**Why we are making these changes:**
Currently, stale temporary directories and files from UDFs and sorting
operations can accumulate over time(if you kill -9 your dn or there is
still running queries while stopping), which unnecessarily wastes disk
space.

**What is included in this PR:**
- **Automated Resource Cleanup:** We added a new `cleanupSortTmpDir` method
to clear out stale sort temporary directories during the DataNode `setUp`
process. Similarly, `TemporaryQueryDataFileService` now automatically
deletes stale temporary directories during both startup and shutdown. These
automated cleanups keep our storage footprint optimal, which is highly
beneficial whether you are using the standard tree mode or Table Mode.
- **General Code Maintenance:** We removed an outdated TODO in
`ExecutableManager`, improved some comment formatting, and added a missing
`Collections` import in `TemporaryQueryDataFileService`.

You can review the changes here: https://github.com/apache/iotdb/pull/17377

Best regards,
--------------------
Yuan Tian

Reply via email to