Over a million developers have joined DZone.

New Solr 3.6, 4.x Feature: Checking Index Locks at Startup

· Java Zone

Navigate the Maze of the End-User Experience and pick up this APM Essential guide, brought to you in partnership with CA Technologies

An issue related to index locks in Solr during startups was patched for the 3.6 branch and 4.x trunk.  In current versions of Apache Solr, when you didn't use an option called "unlockOnStartup," you wouldn't know if your index was locked until a user tried adding a document to it.  

SOLR-3156 was recently given a patch by Luca Cavanna, which was committed by Martijn van Groningen:  

Description
When using simple or native lockType and the application server is not shutdown properly (kill -9), you don't notice problems until someone tries to add or delete a document. In fact, you get errors every time Solr opens a new IndexWriter on the "locked" index. I'm aware of the unlockOnStartup option, but I'd prefer to know and act properly when there's a lock, and I think it would be better to know on startup, since Solr is not going to work properly.


So, you can still use that unlockOnStartup option to make sure that your index is automatically unlocked, but in 3.6 and 4x you won't have to fly blind on startup if you don't have that option enabled.  If the new patch notifies you that your index is locked, you will have to make sure that you unlock the index manually so that Solr will start correctly.

Thrive in the application economy with an APM model that is strategic. Be E.P.I.C. with CA APM.  Brought to you in partnership with CA Technologies.

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}