Skip to content

Conversation

humkum
Copy link
Contributor

@humkum humkum commented Mar 30, 2022

What is the purpose of the change

#4070

Brief changelog

There's no need to binary search offset if the target timestamp is larger than the batchConsumeQueue's max timestamp. So if target timestamp is larger than max timestamp, return max offset directly.

Verifying this change

  • before:
    We will get "-1" when we getOffsetInQueueByTime if the target timestamp is larger than the max queue unit timestamp.
    image
    The result as follows:
    image

  • after :
    After fix that:
    image

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@humkum humkum changed the title bugfix : Returning max queue offset when timestamp is larger than queue-unit max timestamp bugfix : Returning min queue offset when timestamp is larger than queue-unit max timestamp Mar 30, 2022
@Git-Yang Git-Yang changed the title bugfix : Returning min queue offset when timestamp is larger than queue-unit max timestamp [ISSUE #4070] bugfix : Returning min queue offset when timestamp is larger than queue-unit max timestamp Mar 31, 2022
@Git-Yang Git-Yang linked an issue Mar 31, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Mar 31, 2022

Codecov Report

Merging #4071 (5590ea2) into 5.0.0-beta (52482d4) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@               Coverage Diff                @@
##             5.0.0-beta    #4071      +/-   ##
================================================
+ Coverage         43.09%   43.12%   +0.02%     
- Complexity         6014     6021       +7     
================================================
  Files               795      795              
  Lines             56825    56828       +3     
  Branches           7780     7781       +1     
================================================
+ Hits              24491    24509      +18     
+ Misses            29142    29124      -18     
- Partials           3192     3195       +3     
Impacted Files Coverage Δ
...apache/rocketmq/store/queue/BatchConsumeQueue.java 69.50% <100.00%> (-0.65%) ⬇️
...ava/org/apache/rocketmq/test/util/VerifyUtils.java 46.26% <0.00%> (-2.99%) ⬇️
...org/apache/rocketmq/common/stats/StatsItemSet.java 41.79% <0.00%> (-1.50%) ⬇️
...ava/org/apache/rocketmq/filter/util/BitsArray.java 59.82% <0.00%> (ø)
...a/org/apache/rocketmq/store/StoreStatsService.java 48.61% <0.00%> (ø)
...ent/impl/consumer/DefaultLitePullConsumerImpl.java 67.92% <0.00%> (+0.17%) ⬆️
.../apache/rocketmq/logging/inner/LoggingBuilder.java 64.71% <0.00%> (+0.31%) ⬆️
...rocketmq/broker/processor/PopMessageProcessor.java 39.64% <0.00%> (+0.53%) ⬆️
...cketmq/broker/schedule/ScheduleMessageService.java 57.17% <0.00%> (+1.17%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52482d4...5590ea2. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 47.258% when pulling 5590ea2 on humkum:batch-bugfix into 52482d4 on apache:5.0.0-beta.

@humkum
Copy link
Contributor Author

humkum commented Apr 8, 2022

@lizhiboo Hi, would you please check if this pr could be merged?

@humkum
Copy link
Contributor Author

humkum commented Apr 12, 2022

@lizhiboo @Git-Yang @panzhi33 ping~

@cserwen cserwen merged commit 19996a0 into apache:5.0.0-beta May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BatchCQ]Query Message by time failed
10 participants