Github user fdaniel7 commented on the issue:

    https://github.com/apache/incubator-geode/pull/245
  
    It looks like when tryPrimary == false, the intention was that 
ClientMetadata::getServerLocation() will return a secondary bucket from 
m_bucketServerLocationsList[bucketId], considering that there's only one 
primary location and 0 or more secondaries. the range of the randomization is 
definitely wrong in 
m_bucketServerLocationsList[bucketId].at(randgen((int)m_bucketServerLocationsList[bucketId].size())).
 Since we don't want to assume that the primary is always located in 
m_bucketServerLocationsList[bucketId].at(0), a while loop is added.
    I don't see a point splitting this function to sections unless  we want 
specifically primary bucket or secondary.
    
    The reason why I wanted to change this code is because  
ClientMetadataService::markPrimaryBucketForTimeoutButLookSecondaryBucket() 
doesn't work properly since prBuckets->setBucketTimeout(i) will be called only 
if getServerLocation randomized the primary bucket, which makes no sense.
    I'm going to add new pull request with a new function for marking buckets 
as blacklisted.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to