Github user upthewaterspout commented on a diff in the pull request:
https://github.com/apache/geode/pull/318#discussion_r92688937
--- Diff:
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
---
@@ -8751,18 +8751,26 @@ public Index createIndex(boolean
remotelyOriginated, IndexType indexType, String
// Second step is iterating over REs and populating all the created
indexes
if (unpopulatedIndexes != null && unpopulatedIndexes.size() > 0) {
- throwException = populateEmptyIndexes(unpopulatedIndexes,
exceptionsMap);
+ throwException |= populateEmptyIndexes(unpopulatedIndexes,
exceptionsMap);
}
// Third step is to send the message to remote nodes
// Locally originated create index request.
// Send create request to other PR nodes.
- throwException =
+ throwException |=
sendCreateIndexesMessage(remotelyOriginated, indexDefinitions,
indexes, exceptionsMap);
// If exception is throw in any of the above steps
if (throwException) {
- throw new MultiIndexCreationException(exceptionsMap);
+ try {
+ for (String indexName : exceptionsMap.keySet()) {
+ Index index = indexManager.getIndex(indexName);
+ indexManager.removeIndex(index);
+ removeIndex(index, remotelyOriginated);
--- End diff --
That's right. In my test, once I fixed the fact that we were losing the
throwException flag, it didn't actually use the index, but the index was still
there if you actually called getIndex.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---