Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-38194

Lucene index accessor could be unsynchronized in a cluster environment

    Details

      Description

      This ticket is created to avoid unsynch Index Accessor in a cluster environment.

      Currently, it depends on the first action that initialize this object, if it begins from a manual reindex an unsynch index accessor is cached.

      Steps to reproduce having two nodes:

      1. Starts node1.
      2. Login into the portal and regenerate search indexeses from Control Panel > Server Administration > Button: reindex all search index. (You have to avoid to navigate to other pages, go directly to Control Panel after login)

      Debugging it can be observed that an instance of unsynch index accessor is cached through the method com.liferay.portal.search.lucene.LuceneHelperImpl.getIndexAccessor(long)

      In 6.0.12 and 6.1.20, this could cause org.apache.lucene.store.AlreadyClosedException during simmultaneous reindex from different nodes.

      See full stacktrace:

      11:13:40,185 INFO  [http-bio-8080-exec-6][LuceneIndexer:129] Reindexing Lucene completed in 75 seconds
      11:13:40,186 INFO  [http-bio-8080-exec-6][EditServerAction:511] Synchronizecluster index loading for destinations [liferay/search_writer/SYSTEM_ENGINE]
      11:13:40,186 INFO  [http-bio-8080-exec-6][EditServerAction:525] There are 5 synchronization threads
      11:13:40,188 INFO  [liferay/search_writer/SYSTEM_ENGINE-1][EditServerAction:883] Thread name liferay/search_writer/SYSTEM_ENGINE-1 with thread ID 83 synchronized on latch. Waiting for others.
      11:13:43,113 INFO  [http-bio-8080-exec-2][LuceneIndexer:81] Reindexing Lucene started
      11:13:43,125 INFO  [liferay/search_writer/SYSTEM_ENGINE-5][EditServerAction:883] Thread name liferay/search_writer/SYSTEM_ENGINE-5 with thread ID 189 synchronized on latch. Waiting for others.
      11:13:43,128 INFO  [liferay/search_writer/SYSTEM_ENGINE-3][EditServerAction:883] Thread name liferay/search_writer/SYSTEM_ENGINE-3 with thread ID 135 synchronized on latch. Waiting for others.
      11:13:43,129 INFO  [liferay/search_writer/SYSTEM_ENGINE-2][EditServerAction:883] Thread name liferay/search_writer/SYSTEM_ENGINE-2 with thread ID 84 synchronized on latch. Waiting for others.
      11:13:43,128 INFO  [liferay/search_writer/SYSTEM_ENGINE-4][EditServerAction:883] Thread name liferay/search_writer/SYSTEM_ENGINE-4 with thread ID 176 synchronized on latch. Waiting for others.
      11:13:43,131 INFO  [com.liferay.portlet.admin.action.EditServerAction-1][EditServerAction:940] Monitor thread name com.liferay.portlet.admin.action.EditServerAction-1 with thread ID 190 unlocked latch. Notified peers to start index loading.
      11:13:43,216 ERROR [http-bio-8080-exec-9][NtlmPostFilter:81] org.apache.lucene.store.AlreadyClosedException: this IndexWriter is closed
      org.apache.lucene.store.AlreadyClosedException: this IndexWriter is closed
              at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:739)
              at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:744)
              at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3519)
              at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3505)
              at com.liferay.portal.search.lucene.dump.DumpIndexDeletionPolicy.dump(DumpIndexDeletionPolicy.java:44)
              at com.liferay.portal.search.lucene.IndexAccessorImpl.dumpIndex(IndexAccessorImpl.java:108)
              at com.liferay.portal.search.lucene.LuceneHelperImpl.dumpIndex(LuceneHelperImpl.java:304)
              at com.liferay.portal.search.lucene.LuceneHelperUtil.dumpIndex(LuceneHelperUtil.java:303)
              at com.liferay.portal.servlet.LuceneServlet.service(LuceneServlet.java:82)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
              at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
              at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
              at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:216)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
              at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:662)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 4 weeks, 3 days ago

                  Packages

                  Version Package
                  6.0.X EE
                  6.1.X EE
                  6.2.0 CE B1