"java.lang.IllegalStateException" during diskstore validation process in GemFire
search cancel

"java.lang.IllegalStateException" during diskstore validation process in GemFire

book

Article ID: 294412

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

When trying to validate disk stores, you may encounter a java.lang.IllegalStateException similar to the following:
gfsh>validate offline-disk-store --name=MyDiskStore --disk-dirs=/data/backups
java.lang.IllegalStateException: The init file /data/backups/BACKUMyDiskStore.if does not exist.
    at org.apache.geode.internal.cache.DiskInitFile.<init>(DiskInitFile.java:1902)
    at org.apache.geode.internal.cache.DiskStoreImpl.loadFiles(DiskStoreImpl.java:1964)
    at org.apache.geode.internal.cache.DiskStoreImpl.<init>(DiskStoreImpl.java:498)
    at org.apache.geode.internal.cache.DiskStoreImpl.createForOffline(DiskStoreImpl.java:4170)
    at org.apache.geode.internal.cache.DiskStoreImpl.createForOfflineValidate(DiskStoreImpl.java:4126)
    at org.apache.geode.internal.cache.DiskStoreImpl.validate(DiskStoreImpl.java:4276)
    at org.apache.geode.management.internal.cli.util.DiskStoreValidater.validate(DiskStoreValidater.java:53)
    at org.apache.geode.management.internal.cli.util.DiskStoreValidater.main(DiskStoreValidater.java:34)


Environment

Product Version: 9.10, 10.0

Resolution

When a member cannot find previously backed up data, or if the previously backed up data is corrupt, the command performs a full backup on that member. For more information, refer to backup disk-store. 

In order to validate the disk store from a full backup, instead of using '/data/backups', you should ensure that the parameter '--disk-dirs' is pointing to the 'dir0' directory. This directory contains all the files from the backup, as shown in  following example. 

gfsh>validate offline-disk-store --name=MyDiskStore --disk-dirs=/data/backups/2021-01-26-15-58-25/192_168_86_21_server1_48674_v1_41001/diskstores/MyDiskStore_1f228467844d4cd5-a79438cad3ee96f5/dir0
/regionA: entryCount=1024
Total number of region entries in this disk store is: 1024


Alternately, you can copy all files from the 'dir0' directory to a separate directory and then work on the validation process with that.

In order to validate the disk store from an incremental backup, as shown in the following incremental backup, you might need to include both the path to your backup files and the path to the baseline files in the parameter '--disk-dirs' within the following gfsh script. 

validate offline-disk-store --name=value --disk-dirs=value(,value)*


For more information on validating the disk store, refer to validate offline-disk-store.

For example, use a gfsh script similar to the following to complete the incremental backup:

backup disk-store --dir=/data/increm-backup --baseline-dir=/data/backups


Then your gfsh script for the disk store validation should be:

validate offline-disk-store --name=value --disk-dirs=/data/increm-backup/.../.../dir0,/data/backups