[ https://issues.apache.org/jira/browse/GEODE-8112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17112451#comment-17112451 ]
ASF GitHub Bot commented on GEODE-8112: --------------------------------------- pivotal-eshu commented on a change in pull request #5102: URL: https://github.com/apache/geode/pull/5102#discussion_r428171595 ########## File path: geode-dunit/src/main/java/org/apache/geode/management/internal/cli/commands/QueryCommandDUnitTestBase.java ########## @@ -310,4 +323,40 @@ public void setValue1(Value1 value1) { this.value1 = value1; } } + + @Test + public void testSimpleQueryWithProxyRegion() { + server1.invoke(() -> setupReplicatedProxyRegion(DATA_REGION_WITH_PROXY_NAME)); + server2.invoke(() -> setupReplicatedRegion(DATA_REGION_WITH_PROXY_NAME)); + locator.waitUntilRegionIsReadyOnExactlyThisManyServers(DATA_REGION_WITH_PROXY_NAME_PATH, 2); + + server1.invoke(() -> prepareDataForRegion(DATA_REGION_WITH_PROXY_NAME_PATH)); + + String member = getHostingMember(); + Random random = new Random(System.nanoTime()); + int randomInteger = random.nextInt(COUNT); + String query = "query --member=" + member + + " --query=\"select ID , status , createTime , pk, floatMinValue from " + + DATA_REGION_WITH_PROXY_NAME_PATH + " where ID <= " + randomInteger + + "\" --interactive=false"; + + CommandResult commandResult = gfsh.executeCommand(query); + validateSelectResult(commandResult, true, (randomInteger + 1), + new String[] {"ID", "status", "createTime", "pk", "floatMinValue"}); + } + + private String getHostingMember() { + String hostingMember = null; + String findMemberCommand = "describe region --name=" + DATA_REGION_WITH_PROXY_NAME; + CommandResult findMemberResult = gfsh.executeCommand(findMemberCommand); Review comment: Fixed. ---------------------------------------------------------------- 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: us...@infra.apache.org > Need to add a member option in query command > -------------------------------------------- > > Key: GEODE-8112 > URL: https://issues.apache.org/jira/browse/GEODE-8112 > Project: Geode > Issue Type: Bug > Components: gfsh, querying > Reporter: Eric Shu > Assignee: Eric Shu > Priority: Major > Labels: caching-applications > > When gfsh query running on replicate proxy region, it will return 0 results > as no data stored on the proxy region. > To help solving this issue, gfsh querying can add a member option so that > query can route to a particular data host member to get the needed results. > User can use "describe region" to find out which data host, then use it in > the query. -- This message was sent by Atlassian Jira (v8.3.4#803005)