Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-2216

PartitionedRegion.createIndexes ignores exceptions, resulting in corrupt indexes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • querying
    • None

    Description

      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:

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

      This method should always throw an exception if the index creation failed.

      Attachments

        Activity

          People

            upthewaterspout Dan Smith
            upthewaterspout Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: