rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

fix code bug & optimize the memory usage in DefaultMappedFile

Open SeaItFover opened this issue 3 years ago • 8 comments

Make sure set the target branch to develop

What is the purpose of the change MappedFileQueue: if the initial cursor of listIterator equals zero,the previous element will always null. MappedFile: use AtomicIntegerFieldUpdater instead of AtomicInteger.

Brief changelog

Verifying this change DefaultMappedFile class

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.

  • [x] 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.

  • [x] 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.

  • [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.

  • [x] 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.

  • [x] 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.

SeaItFover avatar Jul 23 '22 14:07 SeaItFover

Hello @SeaItFover

Thank you very much for taking the time to contribute to the community, your observation is very keen, I noticed that CI did not pass, please check it first, by the way, you can first create an issue to describe the problem, and then your PR can associate this issue :)

Oliverwqcwrw avatar Jul 26 '22 01:07 Oliverwqcwrw

Hello @SeaItFover

Thank you very much for taking the time to contribute to the community, your observation is very keen, I noticed that CI did not pass, please check it first, by the way, you can first create an issue to describe the problem, and then your PR can associate this issue :)

emmm...我改动很小,不知道哪里有问题

SeaItFover avatar Jul 26 '22 13:07 SeaItFover

image You can click Details to see the Details of the error

Oliverwqcwrw avatar Jul 26 '22 13:07 Oliverwqcwrw

Thanks very much. Hope that my first pr can be merged.

SeaItFover avatar Jul 26 '22 15:07 SeaItFover

Coverage Status

Coverage increased (+0.07%) to 48.801% when pulling 3f242e8aa17f3a71906c791f628bb0a2747e6fd3 on SeaItFover:develop into 8504abfafcf763be6fc593183edb1a2f8f061e51 on apache:develop.

coveralls avatar Jul 26 '22 18:07 coveralls

Codecov Report

Merging #4678 (3f242e8) into develop (8504abf) will decrease coverage by 0.11%. The diff coverage is 47.05%.

@@              Coverage Diff              @@
##             develop    #4678      +/-   ##
=============================================
- Coverage      44.68%   44.57%   -0.12%     
+ Complexity      7540     7519      -21     
=============================================
  Files            977      977              
  Lines          67594    67595       +1     
  Branches        8927     8927              
=============================================
- Hits           30207    30128      -79     
- Misses         33669    33742      +73     
- Partials        3718     3725       +7     
Impacted Files Coverage Δ
...ava/org/apache/rocketmq/store/MappedFileQueue.java 63.77% <0.00%> (ø)
...ache/rocketmq/store/logfile/DefaultMappedFile.java 48.40% <48.48%> (+0.16%) :arrow_up:
...rg/apache/rocketmq/common/stats/StatsSnapshot.java 84.61% <0.00%> (-15.39%) :arrow_down:
...apache/rocketmq/broker/longpolling/PopRequest.java 31.03% <0.00%> (-13.80%) :arrow_down:
...org/apache/rocketmq/common/stats/StatsItemSet.java 41.79% <0.00%> (-13.44%) :arrow_down:
.../apache/rocketmq/common/stats/MomentStatsItem.java 38.09% <0.00%> (-9.53%) :arrow_down:
...ache/rocketmq/common/stats/MomentStatsItemSet.java 39.13% <0.00%> (-8.70%) :arrow_down:
...va/org/apache/rocketmq/common/stats/StatsItem.java 50.00% <0.00%> (-5.00%) :arrow_down:
...ketmq/common/protocol/body/ConsumerConnection.java 95.83% <0.00%> (-4.17%) :arrow_down:
...he/rocketmq/controller/impl/DLedgerController.java 70.65% <0.00%> (-2.72%) :arrow_down:
... and 14 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

codecov-commenter avatar Jul 26 '22 18:07 codecov-commenter

I see that all checks have been approved, when to be merged.

SeaItFover avatar Jul 27 '22 04:07 SeaItFover

Hello, @SeaItFover First of all, we can't timely merger your pr, because all the PMC and Commiters has his own work, everyone is using their free time to contribute to the community, so the review of pr is not certain, as you can see, there are a lot of pr is waiting for review, so I hope you can wait patiently, The community very welcomes contributions from developers

Oliverwqcwrw avatar Jul 27 '22 12:07 Oliverwqcwrw