[ https://issues.apache.org/jira/browse/GEODE-2216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15762674#comment-15762674 ]
ASF subversion and git services commented on GEODE-2216: -------------------------------------------------------- Commit 831219635b66da79acdbd4849f921104e004ac96 in geode's branch refs/heads/develop from [~upthewaterspout] [ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=8312196 ] GEODE-2216: Throwing an exception if index creation fails. Making sure index creation always throws an exception and cleans up the index if the index creation fails. Adding a test that causes index creation failure by failing to deserialize entries. > PartitionedRegion.createIndexes ignores exceptions, resulting in corrupt > indexes > -------------------------------------------------------------------------------- > > Key: GEODE-2216 > URL: https://issues.apache.org/jira/browse/GEODE-2216 > Project: Geode > Issue Type: Bug > Components: querying > Reporter: Dan Smith > Assignee: Mark Bretl > > I tried to create an index on a region with objects that could not be > deserialized (it was a mistake in my code). I found that it actually > *allowed* me to create the index, but my values were not actually indexed. > Looking at the code in PartitionedRegion.createIndexes, it has some > interesting code to maintain a boolean flag that an exception should be > thrown. However, it keeps losing the value of the flag. Here's some of the > code: > {code} > boolean throwException = false; > ... > throwException = > createEmptyIndexes(indexDefinitions, remotelyOriginated, indexes, > exceptionsMap); > ... > //This overwrites the value of throwException > if (unpopulatedIndexes != null && unpopulatedIndexes.size() > 0) { > throwException = populateEmptyIndexes(unpopulatedIndexes, > exceptionsMap); > } > //Same thing here > throwException = > sendCreateIndexesMessage(remotelyOriginated, indexDefinitions, > indexes, exceptionsMap); > {code} > This method should always throw an exception if the index creation failed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)