You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/06/16 13:21:43 UTC

[GitHub] [geode-native] vjr commented on a change in pull request #615: GEODE-8231: remove bucket server location from metadata when server down

vjr commented on a change in pull request #615:
URL: https://github.com/apache/geode-native/pull/615#discussion_r440843882



##########
File path: cppcache/src/ClientMetadata.cpp
##########
@@ -114,14 +114,24 @@ const std::string& ClientMetadata::getColocatedWith() {
   return m_colocatedWith;
 }
 
+void ClientMetadata::removeBucketServerLocation(
+    const std::shared_ptr<BucketServerLocation>& serverLocation) {
+  for (auto&& locations : m_bucketServerLocationsList) {
+    for (unsigned int i = 0; i < locations.size(); i++) {
+      if (locations[i]->getEpString() == (serverLocation->getEpString())) {
+        locations.erase(locations.begin() + i);

Review comment:
       Won't erasing an item from `locations` make it invalid in the `for` loop's `locations.size()` ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org