Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in DefaultEnsemblePlacementPolicy #1788

Merged
merged 1 commit into from
Nov 11, 2018

Conversation

reddycharan
Copy link
Contributor

Descriptions of the changes in this PR:

  • bookieInfoMap is not initialized and newEnsemble will throws BKNotEnoughBookiesException if
    diskWeightBasedPlacement is enabled
  • add test coverage for DefaultEnsemblePlacementPolicy with diskWeightBasedPlacement enabled

- bookieInfoMap is not initialized and newEnsemble will throws BKNotEnoughBookiesException if
diskWeightBasedPlacement is enabled
- add test coverage for DefaultEnsemblePlacementPolicy with diskWeightBasedPlacement enabled
@@ -92,6 +94,9 @@
}
newBookies.add(b);
--ensembleSize;
if (ensembleSize == 0) {
return newBookies;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple return newBookies; after the while loop should be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be, but i just want to follow the existing code format here, like how it is dealt in else block

@@ -92,6 +94,9 @@
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible for weightedSelection.getNextRandom() to return exactly the same one bookie which i.e. is already in the newBookies or excludeBookies thus resulting in the infinite loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if all the bookies already in either in excludeBookies or in a newBookies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sijie
Copy link
Member

sijie commented Nov 11, 2018

run bookkeeper-server replication tests
run integration tests
rebuild java8

@sijie sijie added this to the 4.9.0 milestone Nov 11, 2018
@sijie sijie merged commit 398aa4c into apache:master Nov 11, 2018
sijie pushed a commit that referenced this pull request Nov 11, 2018
Descriptions of the changes in this PR:

- bookieInfoMap is not initialized and newEnsemble will throws BKNotEnoughBookiesException if
diskWeightBasedPlacement is enabled
- add test coverage for DefaultEnsemblePlacementPolicy with diskWeightBasedPlacement enabled

Reviewers: Sijie Guo <sijie@apache.org>, Andrey Yegorov <None>

This closes #1788 from reddycharan/defaultplacementfix

(cherry picked from commit 398aa4c)
Signed-off-by: Sijie Guo <sijie@apache.org>
sijie pushed a commit that referenced this pull request Nov 11, 2018
Descriptions of the changes in this PR:

- bookieInfoMap is not initialized and newEnsemble will throws BKNotEnoughBookiesException if
diskWeightBasedPlacement is enabled
- add test coverage for DefaultEnsemblePlacementPolicy with diskWeightBasedPlacement enabled

Reviewers: Sijie Guo <sijie@apache.org>, Andrey Yegorov <None>

This closes #1788 from reddycharan/defaultplacementfix

(cherry picked from commit 398aa4c)
Signed-off-by: Sijie Guo <sijie@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants