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

   ## Description
   
   ### Avoid replaying successful tablet fragments during type retries
   
   When an insert tablet spans multiple processors or time partitions, a type 
inconsistency in a later fragment triggers a retry. Previously, the retry 
rebuilt every range and inserted already successful fragments again. Track 
processed rows across the attempt and retry only the remaining ranges. If the 
retry also fails, mark only the still-unprocessed rows as failed.
   
   ### Preserve tablets when the table-model pipe builder falls back
   
   `PipeTableModelTsFileBuilderV2` buffered tablets only in its primary builder 
state. If primary TsFile creation failed, the fallback builder therefore 
returned an empty successful result and the buffered data was lost. Mirror each 
buffered tablet into the fallback builder so fallback conversion contains the 
original data.
   
   ### Replace in-memory metadata when loading snapshots
   
   Loading a template snapshot now replaces both template indexes, preventing 
templates created after the snapshot from remaining addressable by ID. Loading 
an empty template-preset snapshot also clears stale preset state when the 
intentionally absent snapshot file represents an empty table.
   
   ### Handle legal short reads in subscription progress snapshots
   
   `FileInputStream.read(byte[])` is allowed to return fewer bytes than 
requested without reaching EOF. Use `DataInputStream.readFully` when restoring 
commit progress so valid snapshots are not rejected when the underlying stream 
returns short reads, while preserving the existing truncated-snapshot handling.
   
   ### Verification
   
   - `mvn spotless:apply -pl iotdb-core/node-commons`
   - `mvn spotless:apply -pl iotdb-core/datanode`
   - `mvn spotless:apply -pl iotdb-core/confignode`
   - `CommitProgressKeeperTest`: 4 tests passed
   - `TemplateTableTest,TemplatePreSetTableTest`: 5 tests passed with 
`-DforkCount=0`
   - `PipeTableModelTsFileBuilderV2Test` and the two targeted `DataRegionTest` 
methods: 3 tests passed with `-DforkCount=0`
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining the "why" and the intent where it would not 
be obvious.
   - [x] added unit tests or modified existing tests to cover the new code 
paths.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   - `DataRegion`
   - `PipeTableModelTsFileBuilderV2`
   - `TemplateTable` and `TemplatePreSetTable`
   - `CommitProgressKeeper`
   


-- 
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