[ 
https://issues.apache.org/jira/browse/GEODE-3898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16235504#comment-16235504
 ] 

ASF GitHub Bot commented on GEODE-3898:
---------------------------------------

jujoramos commented on issue #987: Fix for GEODE-3898
URL: https://github.com/apache/geode/pull/987#issuecomment-341376743
 
 
   Hey @jinmeiliao ,
   
   I've tested the scenario but never added the DUnit test :-/.
   According to my understanding the regions must have the same configuration 
on every member where it's hosted, so in the worst case scenario we'll end up 
persisting the same configuration for the region `N` times, with `N = 
#membersHostingTheRegion`.
   The change will imply changing `CreateDefinedIndexesCommand` to persist the 
cluster configuration **only once per region whenever at least one member was 
able to succesfully create the index on the region**, something like:
   
   ```
   ...
   
   for (final CliFunctionResult funcResult : funcResults) {
        if (cliFunctionResult.isSuccessful()) {
                ...
   
                // Only add the XmlEntity if it wasn't previously added from 
the result of another successfull member. XmlEntity.equals() is already 
implemented.
                if (!xmlEntities.contains(xmlEntities)) {
                        xmlEntities.add(cliFunctionResult.getXmlEntity());
                }
                ...
        }
   }
   
   ...
   
   if (!xmlEntities.isEmpty()) {
        for (XmlEntity xmlEntity : xmlEntities) {
                persistClusterConfiguration(result,
                        () -> 
getSharedConfiguration().addXmlEntity(xmlEntity.get(), group));
        }
   }
   
   ...
   ```
   
   Should I make the changes and add the new DUnit test within the current pull 
request or directly open a new JIRA and add the changes in a new pull request 
relevant to that JIRA?.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Indexes created through the `create defined indexes` command are not 
> persisted to the cluster configuration service
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-3898
>                 URL: https://issues.apache.org/jira/browse/GEODE-3898
>             Project: Geode
>          Issue Type: Bug
>          Components: querying
>            Reporter: Juan José Ramos Cassella
>            Assignee: Juan José Ramos Cassella
>            Priority: Major
>              Labels: configuration, gfsh
>
> When using the cluster configuration service, indexes created through {{gfsh 
> define index}} + {{gfsh create defined indexes}} are not persisted to the 
> cluster configuration service.
> Steps to reproduce:
> # Start a locator with {{enable-cluster-configuration-enabled=true}}.
> # Start a server with {{enable-cluster-configuration-enabled=true}}.
> # Create a sample region: {{gfsh create region --name=TestRegion 
> --type=REPLICATE}}.
> # Define an index: {{gfsh define index --name=index1 --expression=value1 
> --region=TestRegion}}.
> # Created the defined indexes: {{gfsh create defined indexes}}.
> # Restart the cluster.
> # Execute {{list indexes}}. The command returns no indexes.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to