Index verification extension points
The search index verification framework provides extension points for you for more fine-grained monitoring of index health.
Enabling extension points
During verification, the replication handler triggers the check operation for cores in the managed configuration. On the master server, the entry point to call the operations is the core operation request handler, or your own defined custom request handler. Check operations logic is automatically triggered and run every time index replication completely downloads new index files and switches over to the new index. As a result, the upon success or upon failure operations are automatically triggered on the repeater and subordinate servers.
In the managed configuration, you can use the search index verification framework by enabling
healthCheckOps and setting the checkOps flag in the
solrconfig.xml
file.
<lst name="healthCheckOps">
<str name="enable">${healthCheckOps.enable:false}</str>
<str name="forceHealthCheckEveryPollInterval">${healthCheckOps.forceHealthCheckEveryPollInterval:true}</str>
<str name="checkOps">${healthCheckOps.checkOps:com.ibm.commerce.foundation.solr.operation.SolrDoQueryCheckOperation}</str>
<str name="uponSuccessOps">${healthCheckOps.uponSuccessOps:}</str>
<str name="uponFailureOps">${healthCheckOps.uponFailureOps:}</str>
</lst>
healthCheckOps.checkOps
provides access to classes that you can use to customize the verification process. In the example
above, the class being called is SolrDoQueryCheckOperation. The classes enable
you to back up, replicate and query your indexes. Backing up the index
To protect customers' index, it is better to back up the replicated index once a replication is
successful, but otherwise restore the latest backup copy of the index. You can use two classes for
this purpose.
- SolrDoIndexBackupOperation
- Makes an index backup, by default, into core's /data/backups directory.
- SolrDoBackupRestoreOperation
- Restores an index backup from core's /data/backups directory unless a location is specified. Once the restore is done, a folder named snapshot.backup timestamp.restored.restore timestamp be created in the /data folder./data/index.properties will be updated (or created if not exists) to point to the restored folder.
Auxiliary operations
- SolrDoFetchIndexOperation
- Performs a replication from the Search master or a repeater. By default, it will retry the
operation 5 times, each try having a 15 second interval. The class can be invoked through
core name/operation?command=fetchIndex, and can take two
optional parameters.
- retryFetchIndexAttemptsLimit
- Maximum number of retries allowed.
- retryFetchIndexDelay
- Interval between retries.
- SolrDoStatusCheckOperation
- Verifies the connectivity between master and repeater, or repeater and subordinate. It will report failure if the master node is not available. It will verify whether indexes on the master and subordinate node are synchronized.
- SolrDoQueryCheckOperation
- Performs a *:* query against the current active index, and reports the number of documents in the index.