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

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

jdeppe-pivotal commented on a change in pull request #987: Fix for GEODE-3898
URL: https://github.com/apache/geode/pull/987#discussion_r147428122
 
 

 ##########
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommand.java
 ##########
 @@ -89,23 +88,25 @@ public Result createDefinedIndexes(
 
           if (cliFunctionResult.isSuccessful()) {
             successfulMembers.add(cliFunctionResult.getMemberIdOrName());
-
-            if (xmlEntity.get() == null) {
-              xmlEntity.set(cliFunctionResult.getXmlEntity());
-            }
+            xmlEntities.add(cliFunctionResult.getXmlEntity());
           } else {
             final String exceptionMessage = cliFunctionResult.getMessage();
             Set<String> failedMembers = indexOpFailMap.get(exceptionMessage);
 
             if (failedMembers == null) {
               failedMembers = new TreeSet<>();
             }
+
             failedMembers.add(cliFunctionResult.getMemberIdOrName());
             indexOpFailMap.put(exceptionMessage, failedMembers);
           }
         }
       }
 
+      // TODO:
+      // with the current logic some indexes might be correctly created in 
some members and
+      // fail in others; but the user is never notified about these failures 
if there's at least one
+      // successful creation...
 
 Review comment:
   I'm not sure how consistent we are on this, but I think the command should 
fail if there are **any** errors at all. I know that we do this in 
`CreateRegionCommand`. We're adding options to allow for idempotency in all 
commands, so cleaning up from a partial failure will become very easy. i.e. on 
failure you can then issue: `destroy index --if-exists`

----------------------------------------------------------------
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
>              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