You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "jt2594838 (via GitHub)" <gi...@apache.org> on 2026/05/12 06:15:48 UTC
[PR] Fix that partial insert with nulls may result in negative inserted point count [iotdb]
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix that partial insert with nulls may result in negative inserted point count [iotdb]
Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 merged PR #17640:
URL: https://github.com/apache/iotdb/pull/17640
--
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