[
https://issues.apache.org/jira/browse/GEODE-8186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17116819#comment-17116819
]
Dave Barnes commented on GEODE-8186:
------------------------------------
[~eshu] provided raw material - code and commentary:
Here is the what --member option should be used. When there is a region having
both REPLICATE and REPLICATE_PROXY region shortcuts on servers. Query using
gfsh will be executed on a member and the member executes the query from its
local cache. If query executed on a member with REPLICATE_PROXY, the query will
return 0 result.
To cope with this issue, user can use --member option to specify the query to
be run on a member hosting the data.
gfsh>connect --locator "localhost[64570]"
Connecting to Locator at [host=localhost, port=64570] ..
Connecting to Manager at [host=localhost, port=20571] ..
Successfully connected to: [host=localhost, port=20571]gfsh>describe region
--name "portfolio"
Name : portfolio
Data Policy : replicate
Hosting Members : server-2Non-Default Attributes Shared By Hosting Members
Type | Name | Value
------ | ----------- | ---------------
Region | data-policy | REPLICATE
| size | 10
| scope | distributed-ackName : portfolio
Data Policy : empty
Accessor Members : server-1Non-Default Attributes Shared By Accessor Members
Type | Name | Value
------ | ----------- | ---------------
Region | data-policy | EMPTY
| size | 0
| scope | distributed-ack--> query returns 0 rows if query is routed on
to a member without hosting data.
gfsh>query --query="select ID, status from /portfolio where ID < 2"
Result : true
Limit : 100
Rows : 0--> query should specify a member hosting the data to perform the
query to get correct data.
gfsh>query --query="select ID, status from /portfolio where ID < 2"
--member="server-2"
Result : true
Limit : 100
Rows : 2ID | status
-- | --------
0 | active
1 | inactive (edited)
> User Guide: add example for gfsh query --member option
> ------------------------------------------------------
>
> Key: GEODE-8186
> URL: https://issues.apache.org/jira/browse/GEODE-8186
> Project: Geode
> Issue Type: Sub-task
> Components: docs
> Reporter: Dave Barnes
> Priority: Major
>
> GEODE-8112 added a --member option to the gfsh query command.
> Add a usage example to the User Guide
--
This message was sent by Atlassian Jira
(v8.3.4#803005)