Pivotal Knowledge Base

Follow

NullPointerException is thrown during index recovery

Environment

GemFire XD 1.3 and later

Purpose

The purpose of this article is to describe how to resolve the issue when a NullPointerException (NPE) is thrown at start up during index recovery.

Symptom

The NPE that is thrown during index recovery looks like the following:

[error 2015/10/16 07:20:16.523 CDT <Function Execution Processor11> tid=0x80] BatchJob#run failed in inserting index key=tableinfo(true).CompactCompositeIndexKey@274ce5c=(element[0]=AL,element[1]=8002), value=VersionedBucketDiskRowLocationLRURegionEntry@4297fb46(key=; rawValue=null; lockState=0x0; bucketId=94), into index [local-index: TEST.IX_CUSTOMER_03:base-table:TEST.CUSTOMER, id: Container(0, 343), isAppTable=false]
java.lang.NullPointerException
at com.pivotal.gemfirexd.internal.iapi.types.DataTypeUtilities.compare(DataTypeUtilities.java:2138)
at com.pivotal.gemfirexd.internal.engine.access.index.key.IndexKeyComparator.compare(IndexKeyComparator.java:259)
at java.util.TimSort.binarySort(TimSort.java:265)
at java.util.TimSort.sort(TimSort.java:208)
at java.util.Arrays.sort(Arrays.java:727)
at com.gemstone.gemfire.internal.cache.OplogIndexRecoveryJobPart$IndexBulkJob.executeJob(OplogIndexRecoveryJobPart.java:126)
at com.gemstone.gemfire.internal.cache.BatchJobControl$BatchJob.run(BatchJobControl.java:169)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at com.gemstone.gemfire.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:725)
at com.gemstone.gemfire.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1175)
at java.lang.Thread.run(Thread.java:745)

Resolution

The solution to this issue is to remove the problematic idxrf file(s). It is totally safe to delete the idxrf files as they will be recreated automatically when the member starts up. The idxrf files are used for faster recovery of indexes and if not present, then table data is used instead to create the indexes.

Comments

Powered by Zendesk