Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-7265

Could not obtain Lock on lucene index Lock

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: Upcoming Release
    • Component/s: lucene
    • Labels:
      None

      Description

      I found this message in error.log

      xer_default_products DocumentIndexer E Could not obtain Lock on lucene index Lock held by this virtual machine: C:\projectASF-Mars\ofbiz\runtime\indexes\products\write.lock

      Here is Jacopo's answer:

      We should not worry (because the "lucene" component is just an experimental one) but let's keep an eye on it: it is caused when two threads are trying to update documents in the Lucene index; it may happen when two events modify data that trigger the execution of the document update. We could consider to enhance the DocumentIndexer to properly manage these scenarios.

        Issue Links

          Activity

          Hide
          amardeepsj Amardeep Singh Jhajj added a comment -

          Hi Jacques Le Roux,

          I am able to reproduce this on my dev machine. Here is the steps to regenerate it:

          1. Go to https://localhost:8443/content/control/AdminIndex
          2. Click on Index Products button.

          As per my analysis, the reason of error is write lock on lucene indexes (created by lucene indexing process in lucene component) by Solr. Have a look on specialpurpose/solr/home/solrdefault/conf/solrconfig.xml line:

            <dataDir>${solr.data.dir:runtime/indexes}</dataDir>
          

          Should point to:

            <dataDir>${solr.data.dir:specialpurpose/solr/home/solrdefault/runtime/indexes/}</dataDir>
          

          Solr currently pointing to lucene indexes and creating a lock on it. We can't index products anymore using lucene indexing as it has lock from Solr.

          So currently all the search results we can see on Solr Search

          https://localhost:8443/solr/#/solrdefault/query 
          

          is lucene indexed results.

          We have not created any indexes using Solr itself. Thanks

          Show
          amardeepsj Amardeep Singh Jhajj added a comment - Hi Jacques Le Roux , I am able to reproduce this on my dev machine. Here is the steps to regenerate it: 1. Go to https://localhost:8443/content/control/AdminIndex 2. Click on Index Products button. As per my analysis, the reason of error is write lock on lucene indexes (created by lucene indexing process in lucene component) by Solr. Have a look on specialpurpose/solr/home/solrdefault/conf/solrconfig.xml line: <dataDir>${solr.data.dir:runtime/indexes}</dataDir> Should point to: <dataDir>${solr.data.dir:specialpurpose/solr/home/solrdefault/runtime/indexes/}</dataDir> Solr currently pointing to lucene indexes and creating a lock on it. We can't index products anymore using lucene indexing as it has lock from Solr. So currently all the search results we can see on Solr Search https: //localhost:8443/solr/#/solrdefault/query is lucene indexed results. We have not created any indexes using Solr itself. Thanks
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Thanks for the thorough analsysis Amardeep! I will check that ASAP...

          Show
          jacques.le.roux Jacques Le Roux added a comment - Thanks for the thorough analsysis Amardeep! I will check that ASAP...
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Thanks a bunch Amardeep, well spotted!

          Your solution is in
          trunk r1791625
          R16.11 and R15.12 r1791626

          Show
          jacques.le.roux Jacques Le Roux added a comment - Thanks a bunch Amardeep, well spotted! Your solution is in trunk r1791625 R16.11 and R15.12 r1791626
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          In
          trunk r1792257
          R16.11 and R15.12 r1792258
          I fixed the path, it starts at home now

          Show
          jacques.le.roux Jacques Le Roux added a comment - In trunk r1792257 R16.11 and R15.12 r1792258 I fixed the path, it starts at home now
          Hide
          jacques.le.roux Jacques Le Roux added a comment - - edited

          We have though a problem why the lucence indexes location in the solr plugins!

          I guess (and IIRW) this is due to some work done to somehow merge functionalities between solr and lucene component. Then we should rather have the indexes at a common level. So I suggest to create them under the global runtime level. I will ask about this on dev ML before creating a Jira. Also svn:ignoring them then will be good thing...

          Show
          jacques.le.roux Jacques Le Roux added a comment - - edited We have though a problem why the lucence indexes location in the solr plugins! I guess (and IIRW) this is due to some work done to somehow merge functionalities between solr and lucene component. Then we should rather have the indexes at a common level. So I suggest to create them under the global runtime level. I will ask about this on dev ML before creating a Jira. Also svn:ignoring them then will be good thing...
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          OK done for
          trunk r1794132
          R16.11 and R15.12 r1794133

          No need to svn:ignore, done at a upper level

          Show
          jacques.le.roux Jacques Le Roux added a comment - OK done for trunk r1794132 R16.11 and R15.12 r1794133 No need to svn:ignore, done at a upper level
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          The index directory name has been changed by OFBIZ-8316, setting it again

          Show
          jacques.le.roux Jacques Le Roux added a comment - The index directory name has been changed by OFBIZ-8316 , setting it again
          Hide
          mbrohl Michael Brohl added a comment -

          I had this error today also while testing.

          Show
          mbrohl Michael Brohl added a comment - I had this error today also while testing.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          At r1794771 Jinghai committed for OFBIZ-8316 with this comment
          Updated Solr from 6.2.1 to 6.5.1...[snip]...

          But unfortunately he reintroduced the path for indexes to /runtime/indexes/products which breaks OFBIZ-7265 on this aspect where I then set it to runtime/indexes/solr to not confuse with Lucene index

          I have decide to make things even more clear by using now runtime/indexes/solr/products

          I hope nobody will break it again, even if it has no functional impact.

          Fixed at revision: 1800453

          Show
          jacques.le.roux Jacques Le Roux added a comment - At r1794771 Jinghai committed for OFBIZ-8316 with this comment Updated Solr from 6.2.1 to 6.5.1... [snip] ... But unfortunately he reintroduced the path for indexes to /runtime/indexes/products which breaks OFBIZ-7265 on this aspect where I then set it to runtime/indexes/solr to not confuse with Lucene index I have decide to make things even more clear by using now runtime/indexes/solr/products I hope nobody will break it again, even if it has no functional impact. Fixed at revision: 1800453
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Michael, you mean the error in description? This should no longer happen. I reopened for another (not functional) reason explained in the comment above.

          Show
          jacques.le.roux Jacques Le Roux added a comment - Michael, you mean the error in description? This should no longer happen. I reopened for another (not functional) reason explained in the comment above.

            People

            • Assignee:
              jacques.le.roux Jacques Le Roux
              Reporter:
              jacques.le.roux Jacques Le Roux
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development