You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bb...@apache.org on 2021/05/04 17:35:18 UTC

[geode-native] branch develop updated: GEODE-8405: Don't ask for metadata for replicated regions (#800)

This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new 74c3fb0  GEODE-8405: Don't ask for metadata for replicated regions (#800)
74c3fb0 is described below

commit 74c3fb0f6ebed17b4b69b13f1b929b0c0acc44a4
Author: Blake Bender <bb...@pivotal.io>
AuthorDate: Tue May 4 10:35:09 2021 -0700

    GEODE-8405: Don't ask for metadata for replicated regions (#800)
    
    Sending GET_CLIENT_PR_METADATA to a server for a replicated region generated an EXCEPTION response message, which the native client would then ignore. Convention in the Java client is to check for a bucket count of -1, indicating replicated region, and skip the metadata request in that case.
---
 cppcache/src/ClientMetadataService.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/cppcache/src/ClientMetadataService.cpp b/cppcache/src/ClientMetadataService.cpp
index 7b1bde6..42f422f 100644
--- a/cppcache/src/ClientMetadataService.cpp
+++ b/cppcache/src/ClientMetadataService.cpp
@@ -121,6 +121,14 @@ void ClientMetadataService::getClientPRMetadata(const char* regionFullPath) {
     if (err == GF_NOERR &&
         reply.getMessageType() ==
             TcrMessage::RESPONSE_CLIENT_PARTITION_ATTRIBUTES) {
+      // By convention, server returns -1 bucket count to indicate replicated
+      // region
+      if (reply.getNumBuckets() == -1) {
+        LOGDEBUG(
+            "ClientMetadataService::getClientPRMetadata: region is"
+            "replicated, not partitioned - no metadata");
+        return;
+      }
       cptr = std::make_shared<ClientMetadata>(reply.getNumBuckets(),
                                               reply.getColocatedWith(), m_pool,
                                               reply.getFpaSet());