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

   ## Summary
   
   When a partial insert has failed measurements (\measurements[i] == null\), 
the \pointsInserted\ counter could go negative in two paths:
   
   1. **\AbstractMemTable.insertAlignedRow\**: a failed measurement slot has 
both \measurements[i] == null\ and \alues[i] == null\. The old guard \if 
(values[i] == null)\ did not check \measurements[i]\ first, so the null value 
was counted as a \
   ullPoint\ and subtracted from the total, producing a negative result.
   
   2. **\AbstractMemTable.computeTabletNullPointsNumber\**: failed measurement 
columns were not skipped before inspecting their bitmaps, so any marked bits in 
a failed column were incorrectly counted as null points.
   
   ## Changes
   
   - **\InsertNode.java\**: add \isMeasurementFailed(int index)\ helper that 
returns \measurements[index] == null\.
   - **\AbstractMemTable.java\**:
     - \insertAlignedRow\: change guard to \measurements[i] != null && 
values[i] == null\ so failed measurements are excluded from \
   ullPointsNumber\.
     - \computeTabletNullPointsNumber\: skip columns where 
\isMeasurementFailed(i)\ is true before counting bitmap marks.
   
   ## Tests
   
   - **\InsertNodeIsMeasurementFailedTest\**: unit tests for the new 
\isMeasurementFailed\ method on both \InsertRowNode\ and \InsertTabletNode\, 
covering no-failure, single failure, all-failed, and idempotent mark cases.
   - **\AbstractMemTablePartialInsertTest\**: unit tests for \insertAlignedRow\ 
and \insertTablet\ with precise \ssertEquals\ assertions on \pointsInserted\ 
and \     otalPointsNum\, covering all combinations of failed measurements and 
null bitmaps.


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