Skip to content

Conversation

@zhouxinyu
Copy link
Member

What is the purpose of the change

To resolve the issue ROCKETMQ-270.

Slave Broker can't flush data to disk normally if the master broker has been cleaned commit log.

Brief changelog

When the flush position is zero and the first MappedFile's start offset is non-zero, move it forward to the first MappedFile's start offset. Otherwise, slave broker can't flush data to disk normally.

Verifying this change

  1. Start master broker, and write lots of messages until broker starts cleaning commit log.
  2. When the first commit log file isn't 00000000000000, start slave broker.
  3. Slave broker now can flush data normally.

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA 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 [ROCKETMQ-XXX] 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 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.

@vongosling
Copy link
Member

LGTM

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 39.118% when pulling f18dc03 on zhouxinyu:ROCKETMQ-270 into 1a88fe0 on apache:develop.

@vongosling vongosling merged commit 3cb4bdb into apache:develop Dec 13, 2017
@vongosling vongosling added this to the 4.3.0 milestone Jun 25, 2018
renshuaibing-aaron pushed a commit to renshuaibing-aaron/rocketmq that referenced this pull request Apr 13, 2020
[ROCKETMQ-270] Move flush position forward to first MappedFile whose start offset is non-zero
JiaMingLiu93 pushed a commit to JiaMingLiu93/rocketmq that referenced this pull request May 28, 2020
[ROCKETMQ-270] Move flush position forward to first MappedFile whose start offset is non-zero
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.

4 participants