You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "shuwenwei (via GitHub)" <gi...@apache.org> on 2026/03/11 10:46:35 UTC

[PR] Fix incorrect early termination in descending scan of unpackOneFakeMemChunkMetaData [iotdb]

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

   ## Description
   ### Problem
   In the streaming query path of MemChunkLoader, unpackOneFakeMemChunkMetaData iterates through statisticsList to construct LazyMemVersionPageReader instances.
   
   However, the original implementation always iterated statisticsList in ascending order while using the following early termination logic:
   ```
   (orderUtils.getAscending() && orderTime > satisfiedTimeRange.getMax())
   || (!orderUtils.getAscending() && orderTime < satisfiedTimeRange.getMin())
   ```
   When executing a descending scan, statisticsList is still ordered from small to large timestamps. This may cause the loop to break prematurely because the first element already satisfies orderTime < satisfiedTimeRange.getMin(), even though later elements could still fall within the query time range.
   
   As a result, some valid pages may not be added to the page reader list, leading to missing data during descending scans.
   
   ### Solution
   
   This PR fixes the issue by iterating statisticsList according to the scan order:
   	•	Ascending scan: iterate statisticsList in its natural order.
   	•	Descending scan: iterate statisticsList in reverse order.
   
   With this change, the early termination condition (break) becomes correct for both scan directions because the iteration order now matches the scan order.
   
   The behavior is now consistent with the logic used in unpackOneChunkMetaData, where pageReaderList is also traversed differently depending on the scan order.


-- 
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 incorrect early termination in descending scan of unpackOneFakeMemChunkMetaData [iotdb]

Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 merged PR #17283:
URL: https://github.com/apache/iotdb/pull/17283


-- 
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 incorrect early termination in descending scan of unpackOneFakeMemChunkMetaData [iotdb]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #17283:
URL: https://github.com/apache/iotdb/pull/17283#issuecomment-4038696005

   ## [Codecov](https://app.codecov.io/gh/apache/iotdb/pull/17283?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `0%` with `24 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 39.70%. Comparing base ([`ea3cc3c`](https://app.codecov.io/gh/apache/iotdb/commit/ea3cc3cbdef5a354d2db89007681f4e0b707e331?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`b8dad72`](https://app.codecov.io/gh/apache/iotdb/commit/b8dad72a84d72ca1ffba60a14c0d4b0c572b7dd1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iotdb/pull/17283?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...gine/execution/operator/source/SeriesScanUtil.java](https://app.codecov.io/gh/apache/iotdb/pull/17283?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fexecution%2Foperator%2Fsource%2FSeriesScanUtil.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvZXhlY3V0aW9uL29wZXJhdG9yL3NvdXJjZS9TZXJpZXNTY2FuVXRpbC5qYXZh) | 0.00% | [24 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17283?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #17283      +/-   ##
   ============================================
   - Coverage     39.71%   39.70%   -0.01%     
     Complexity      282      282              
   ============================================
     Files          5100     5100              
     Lines        341950   341977      +27     
     Branches      43559    43562       +3     
   ============================================
   - Hits         135798   135796       -2     
   - Misses       206152   206181      +29     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/iotdb/pull/17283?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
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 incorrect early termination in descending scan of unpackOneFakeMemChunkMetaData [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17283:
URL: https://github.com/apache/iotdb/pull/17283#issuecomment-4038372059

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17283) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=17283&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=17283&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=17283&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=17283&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=17283&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17283)
   
   


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