Gemfire: Index fails with 'Updating the Index <index> failed. The index is corrupted and marked as invalid.'
search cancel

Gemfire: Index fails with 'Updating the Index <index> failed. The index is corrupted and marked as invalid.'

book

Article ID: 400276

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

Index fails with 

'Updating the Index <index> failed. The index is corrupted and marked as invalid.'

 when a 'SELECT' query is run with an indexed field. And the server logs reveal the error below.

[warn <ServerConnection on port xxxx Thread 9463> tid=0xxxx] Updating the Index <index> failed. The index is corrupted and marked as invalid.

message: Caused by: org.apache.geode.security.NotAuthorizedException: Unauthorized access to method: <method>

Cause

 

An example scenario:

  You  have an OQL, select distinct i from /<region> r, r.<POJO> p where p.<field> in set(%s), an index with  p.<field> as an indexedExpression

  and you have added an object without the indexed field. 

When the index tries to deserialize the object and invoke the method,  the RestrictedMethodAuthorizer prevents this and throws the  exception 

'Caused by: org.apache.geode.security.NotAuthorizedException: Unauthorized access to method: <method>'

Resolution

To alleviate or work around the issue, change the method invocation authorizer to the JavaBeanAccessorMethodAuthorizer which will allow you to continue and not mark the index corrupted.  Refer to   Method Invocation authorizers for more information.

To detect the bad entries with missing data, follow options suggested in a related KB.