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

   ## Description
   
   ### Make TsFile metric updates idempotent
   
   - Refactor file metric APIs to accept `TsFileResource` directly and derive 
database, region, sequence, size, and file name from the resource.
   - Track whether each `TsFileResource` has been recorded by metrics with an 
atomic flag, preventing duplicate additions or deletions during compaction and 
file lifecycle transitions.
   - Simplify compaction and DataRegion call sites by removing redundant metric 
arguments.
   
   ### Tests
   
   - Extend `CompactionUpdateFileCountTest` to cover repeated metric updates 
and mixed sequence/unsequence resource deletion.
   - Update existing compaction metric tests for the resource-based API.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining the why and the intent of the code wherever 
it would not be obvious for an unfamiliar reader.
   - [x] added or updated unit tests to cover new code paths.
   
   Tested with:
   
   `mvn test -pl iotdb-core/datanode -Dtest=CompactionUpdateFileCountTest 
-DfailIfNoTests=false`
   
   <hr>
   
   ##### Key changed/added classes
   
   - `TsFileMetrics`
   - `TsFileResource`
   - DataRegion compaction tasks and utilities
   - `CompactionUpdateFileCountTest`


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