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: [email protected]

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

Reply via email to