I am running a multi-tenant java high-replication web application on Google AppEngine. The application successfully uses multi-property indices (configured within the datastore-indexes.xml file). Well, at least up until now...
Since today there is at least one namespace that throws DatastoreNeedIndexExceptions when executing a query. The curious thing is that the same query works in other namespaces.
Here is the index configuration from the datastore-indexes.xml and the index status from the admin panel:
<?xml version="1.0" encoding="utf-8"?>
<datastore-indexes autoGenerate="false">
<datastore-index kind="Index_Asc_Asc_Asc_Asc" ancestor="false" source="manual">
<property name="components" direction="asc"/>
<property name="component_0" direction="asc"/>
<property name="component_1" direction="asc"/>
<property name="component_2" direction="asc"/>
<property name="component_3" direction="asc"/>
</datastore-index>
</datastore-indexes>
The corresponding query looks like this:
SELECT __key__ FROM Index_Asc_Asc_Asc_Asc WHERE components = '12340987hja' AND component_0 = 'asdfeawsefad' AND component_1 = '4FnlnSYiJuo25mNU' AND component_3 = 'cvxyvsdfsa' AND component_2 >= 0
When I execute this query within my application or the admin panel datastore view App Engine throws a DatastoreNeedIndexException with the following recommendation. Again, the same query works in other namespaces:
The suggested index for this query is:
<datastore-index kind="Index_Asc_Asc_Asc_Asc" ancestor="false">
<property name="component_0" direction="asc" />
<property name="component_1" direction="asc" />
<property name="component_3" direction="asc" />
<property name="components" direction="asc" />
<property name="component_2" direction="asc" />
</datastore-index>
Investigations:
- I have tried to set autoGenerate="true", but I do get the same error and no new indexes have been added.
- I have tried to execute the query in newly created namespaces: No problems.
- The error does not occur in the development server.
Is there something I am missing? Has anyone else experienced the same problem? Why is the same query working in other namespaces but not in that one?
Thanksalot!