You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "nabarun (JIRA)" <ji...@apache.org> on 2018/06/13 00:00:00 UTC
[jira] [Created] (GEODE-5318) create defined index does not update
cluster config if methods are invoked in the from clause
nabarun created GEODE-5318:
------------------------------
Summary: create defined index does not update cluster config if methods are invoked in the from clause
Key: GEODE-5318
URL: https://issues.apache.org/jira/browse/GEODE-5318
Project: Geode
Issue Type: Bug
Components: querying
Reporter: nabarun
+*Steps to reproduce the issue.*+
# start locator
# start server
# create region
# define index as "define index --name=index --region="Member.entrySet" --expression="value.getId" "
# create defined indexes
This is will result in a failure causing no updates to the cluster config for the newly created indexes. So when a server is restarted , it won't recreate these indexes.
+*Cause of the problem:*+
We try to extract the region name to update the cluster config from the index's "from clause".
We end up getting <region_name>.entrySet . But there are no region named as such so no updates to the cluster config.
+*Solution*+
Use the fix for GEODE-2764 where we can extract the proper region name from the "from clause"
*problematic code:*
{code:java}
RegionConfig region = config.findRegionConfiguration(index.getFromClause());{code}
*fix:*
{code:java}
String regionPath = getValidRegionName(index.getFromClause(), config);
RegionConfig regionConfig = config.findRegionConfiguration(regionPath);{code}
+*Example:*+
Below we can see an complete execution in gfsh which leads to this failure.
{noformat}
_________________________ __
/ _____/ ______/ ______/ /____/ /
/ / __/ /___ /_____ / _____ /
/ /__/ / ____/ _____/ / / / /
/______/_/ /______/_/ /_/ 1.8.0-SNAPSHOT
Monitor and Manage Apache Geode
gfsh>start locator
Starting a Geode Locator in /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/untie-happy-can...
....
Locator in /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/untie-happy-can on 10.0.0.40[10334] as untie-happy-can is currently online.
Process ID: 29310
Uptime: 4 seconds
Geode Version: 1.8.0-SNAPSHOT
Java Version: 1.8.0_161
Log File: /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/untie-happy-can/untie-happy-can.log
JVM Arguments: -Dgemfire.enable-cluster-configuration=true -Dgemfire.load-cluster-configuration-from-dir=false -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806
Class-Path: /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/lib/geode-core-1.8.0-SNAPSHOT.jar:/home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar
Successfully connected to: JMX Manager [host=10.0.0.40, port=1099]
Cluster configuration service is up and running.
gfsh>start server
Starting a Geode Server in /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/fix-vast-kilo...
...
Server in /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/fix-vast-kilo on 10.0.0.40[40404] as fix-vast-kilo is currently online.
Process ID: 29498
Uptime: 2 seconds
Geode Version: 1.8.0-SNAPSHOT
Java Version: 1.8.0_161
Log File: /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/fix-vast-kilo/fix-vast-kilo.log
JVM Arguments: -Dgemfire.default.locators=10.0.0.40[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806
Class-Path: /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/lib/geode-core-1.8.0-SNAPSHOT.jar:/home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar
gfsh>create region --name=Member --type=PARTITION
Member | Status
------------- | -------------------------------------------
fix-vast-kilo | Region "/Member" created on "fix-vast-kilo"
gfsh>define index --name=memberPartyIdIndex --expression="value.getPartyId" --region="/Member.entrySet"
Index successfully defined with following details
Name : memberPartyIdIndex
Expression : value.getPartyId
RegionPath : /Member.entrySet
gfsh>create defined indexes
Member | Status | Message
--------------------------------------- | ------ | --------------------------------
10.0.0.40(fix-vast-kilo:29498)<v1>:1025 | OK | Created index memberPartyIdIndex
failed to update cluster config for cluster. Reason: RegionConfig is null
gfsh>list indexes
Member Name | Member ID | Region Path | Name | Type | Indexed Expression | From Clause | Valid Index
------------- | --------------------------------------- | ----------- | ------------------ | ----- | ------------------ | ---------------- | -----------
fix-vast-kilo | 10.0.0.40(fix-vast-kilo:29498)<v1>:1025 | /Member | memberPartyIdIndex | RANGE | value.getPartyId | /Member.entrySet | true
gfsh>stop server --name
optional --name: Member name or ID of the Cache Server in the Geode cluster.; no default value
gfsh>stop server --name=fix-vast-kilo
Stopping Cache Server running in /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/fix-vast-kilo on 10.0.0.40[40404] as fix-vast-kilo...
Process ID: 29498
Log File: /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/fix-vast-kilo/fix-vast-kilo.log
...
gfsh>start server --name
optional --name: The member name to give this Cache Server in the Geode cluster.; no default value
gfsh>start server --name
optional --name: The member name to give this Cache Server in the Geode cluster.; no default value
gfsh>start server --name=fix-vast-kilo
Starting a Geode Server in /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/fix-vast-kilo...
...
Server in /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/fix-vast-kilo on 10.0.0.40[40404] as fix-vast-kilo is currently online.
Process ID: 29893
Uptime: 2 seconds
Geode Version: 1.8.0-SNAPSHOT
Java Version: 1.8.0_161
Log File: /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/bin/fix-vast-kilo/fix-vast-kilo.log
JVM Arguments: -Dgemfire.default.locators=10.0.0.40[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806
Class-Path: /home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/lib/geode-core-1.8.0-SNAPSHOT.jar:/home/nabarun/Documents/codeWork/dev2/gemfire/open/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar
gfsh>list region
List of regions
---------------
Member
gfsh>list indexes
No Indexes Found
{noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)