You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "HTHou (via GitHub)" <gi...@apache.org> on 2026/09/28 04:33:46 UTC
[PR] Fix deletion matching during compaction for two-level tree paths [iotdb]
HTHou opened a new pull request, #18732:
URL: https://github.com/apache/iotdb/pull/18732
## Description
Fixes deleted data reappearing after inner-space compaction when a tree-model timeseries uses a two-level device path such as `root.repro.s1`.
### Root cause
`MeasurementPath#getIDeviceID()` represents the device of `root.repro.s1` as the segments `[root, repro]`. This device is classified by `IDeviceID#isTableModel()` as table-model, so `CompactionPathUtils#getPath()` uses its table branch. That branch allocated `segmentNum() + 1` nodes and left the final node null. After appending the measurement, compaction looked up modifications with `[root, repro, null, s1]` instead of `root.repro.s1`, so the deletion was not applied while rewriting the source files.
### Changes
- Build table-branch `PartialPath` instances with exactly `segmentNum()` nodes.
- Strengthen unit coverage for table-model devices and two-level tree-model paths.
- Add a tree-model integration test that deletes and recreates `root.repro.s1`, enables sequence inner compaction, waits until the two source TsFiles become one, and verifies that only the recreated point remains.
### Verification
- `mvn spotless:apply -pl integration-test -P with-integration-tests`
- `mvn verify -DskipUTs -Dit.test=IoTDBRecreatedTimeseriesCompactionIT -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false -pl integration-test -am -P with-integration-tests`
- Fixed implementation: 1 test passed.
- Old `segmentNum() + 1` implementation: the same test failed after compaction with `expected:<2> but was:<1>`, confirming that the old point reappeared.
<hr>
This PR has:
- [x] been self-reviewed.
- [x] added unit tests or modified existing tests to cover new code paths.
- [x] added integration tests.
- [x] been tested in a test IoTDB cluster.
<hr>
##### Key changed/added classes
- `CompactionPathUtils`
- `CompactionUtilsTest`
- `IoTDBRecreatedTimeseriesCompactionIT`
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix deletion matching during compaction for two-level tree paths [iotdb]
Posted by "HTHou (via GitHub)" <gi...@apache.org>.
HTHou merged PR #18732:
URL: https://github.com/apache/iotdb/pull/18732
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org