-
Notifications
You must be signed in to change notification settings - Fork 629
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
ISPN-7461 Cache is not rebalanced on merge #5015
Conversation
Can one of the admins verify this patch? |
@danberindei can you take a look at this? It seems this might be a good one for 9.0, wdyt? |
@wburns It's meant for 5.2 :) I don't think we can guarantee much after merge - merge without partition handling is scarcely tested (if at all). A proper solution is related to AP mode - diverged entries merge (I don't know if @ryanemerson is about to work on that given that he has worked on the consistency checker). |
@rvansa Oh I know that we can't guarantee anything after merge in regards to data. I was more asking because this change only has to do with the topology updates. |
Oops, I missed this one... for some reason I'm showing up as a reviewer here but not in the PR list :) I'm don't think this is the right approach.
|
I have rewritten it based on @danberindei comment. The main problem was encapsulation of cache status map. I did not want to modify ClusterTopologyManagerImpl just for test, therefore I use reflection to get that map in TestingUtil. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor comment
ConsistentHash currentCH = cacheTopology.getCurrentCH(); | ||
ConsistentHash updatedMembersCH = chFactory.updateMembers(currentCH, cacheStatus.getMembers()); | ||
ConsistentHash balancedCH = chFactory.rebalance(updatedMembersCH); | ||
if (currentCH == null || balancedCH.equals(currentCH)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If currentCH == null
, updateMembers(currentCH, ...)
would throw a NPE. So we should either check for null
before, or remove the check here. I don't think it's possible to have a CacheTopology
with a currentCH == null
, is it?
@danberindei You were right. I have removed unnecessary null check. |
Integrated, thanks Petr! |
https://issues.jboss.org/browse/ISPN-7461
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1421404
Removed problematic if block.