Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-73593

In Confluence, Lucene connection uses NIOFSDirectory implementation rather then MMapDirectory in Java 11

      Issue Summary

      Confluence Lucene connection uses NIOFSDirectory implementation rather than MMapDirectory in Java 11

      Steps to Reproduce

      1. Install any Confluence version above 7.X that has support for Java 11
      2. The underlying Lucene uses NIOFSDirectory implementation rather than MMapDirectory which is more efficient

      Expected Results

      Confluence should use MMapDirectory with Java 11 as it was with Java 8

      Actual Results

      Confluence uses NIOFS implementation . This can result in multiple outcomes

      1. At scale, this method can be notably less performant for index lookups and searches
      2. Conditionally this results in situations where customers are presented with below error that requires a restart of the instance
        aused by: java.io.IOException: null: NIOFSIndexInput(_f2fd_Lucene41_0.tim in path="/var/atlassian/application-data/confluence/index/_f2fd.cfs" slice=2604086:9597840)
        	at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:191)
        	... 143 more
        Caused by: java.nio.channels.ClosedByInterruptException
        

        This is a known behaviour for NIOFS class https://lucene.apache.org/core/3_5_0/api/all/org/apache/lucene/store/NIOFSDirectory.html

        • NOTE: Accessing this class either directly or indirectly from a thread while it's interrupted can close the underlying file descriptor immediately if at the same time the thread is blocked on IO. The file descriptor will remain closed and subsequent access to NIOFSDirectory will throw a ClosedChannelException. If your application uses either Thread.interrupt() or Future.cancel(boolean) you should use SimpleFSDirectory in favor of NIOFSDirectory.

      Workaround

      Downgrade to Java 8

          Form Name

            [CONFSERVER-73593] In Confluence, Lucene connection uses NIOFSDirectory implementation rather then MMapDirectory in Java 11

            Hi All,

            It seems like there was an oversight on the paperwork for this fix.

            We implemented the backport for this issue in Confluence 7.13.6 on 16 May 2022, but unfortunately that wasn't reflected on this ticket.

            I've corrected that oversight, apologies for the oversight.

            Thanks,
            James Ponting
            Engineering Manager - Confluence Data Center

            James Ponting added a comment - Hi All, It seems like there was an oversight on the paperwork for this fix. We implemented the backport for this issue in Confluence 7.13.6 on 16 May 2022, but unfortunately that wasn't reflected on this ticket. I've corrected that oversight, apologies for the oversight. Thanks, James Ponting Engineering Manager - Confluence Data Center

            would be great to have this fix in in a LTS ^^

            Michael Jänsch added a comment - would be great to have this fix in in a LTS ^^

            David J added a comment -

            I certainly hope a backport to the last LTS release is heavily considered - isn't this the purpose of the LTS acronym after all?

            David J added a comment - I certainly hope a backport to the last LTS release is heavily considered - isn't this the purpose of the LTS acronym after all?

            Hello,

            Please backport this issue to LTS 7.13.

            We hit this issue again. Downgrade of JAVA is not an option.

            Leszek Czaplis added a comment - Hello, Please backport this issue to LTS 7.13. We hit this issue again. Downgrade of JAVA is not an option.

            Lars Klein added a comment -

            @jponting - We were hit suddenly by this 5 weeks after upgrade to 7.13 LTS. Is there any plan to backport the fix to the LTS? 7.16 would be no option for us...

            Lars Klein added a comment - @ jponting - We were hit suddenly by this 5 weeks after upgrade to 7.13 LTS. Is there any plan to backport the fix to the LTS? 7.16 would be no option for us...

            A fix for this issue is available to Server and Data Center customers in Confluence 7.16.0
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            James Whitehead added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.16.0 Upgrade now or check out the Release Notes to see what other issues are resolved.

            Hi All,

            26ca6ee96709 - We're currently working on a fix, however this is proving to be a painful one to resolve. We'll update the ticket as soon as we have additional information.

            With regards to the impact of downgrading Java from 11 to 8, there should be no issues with doing so. As always, we'd encourage you to test the change in a staging environment prior to undertaking the change in production, however I'm not aware of any issues that would be blocking the change at this time.

            Thanks,
            James Ponting
            Premier Support Engineer

            James Ponting added a comment - Hi All, 26ca6ee96709 - We're currently working on a fix, however this is proving to be a painful one to resolve. We'll update the ticket as soon as we have additional information. With regards to the impact of downgrading Java from 11 to 8, there should be no issues with doing so. As always, we'd encourage you to test the change in a staging environment prior to undertaking the change in production, however I'm not aware of any issues that would be blocking the change at this time. Thanks, James Ponting Premier Support Engineer

            Sinan Yildirim added a comment - - edited

            Facing that issue in Conf 7.6.3.

            Is there any plan to fix that? We are facing frequently that issue with search index. Without restarting the cluster node the search is not working.

            This is annoying and makes our system instable. Are there any side effects expected when we downgrade the JAVA 11 to 8?

            Sinan Yildirim added a comment - - edited Facing that issue in Conf 7.6.3. Is there any plan to fix that? We are facing frequently that issue with search index. Without restarting the cluster node the search is not working. This is annoying and makes our system instable. Are there any side effects expected when we downgrade the JAVA 11 to 8?

              Unassigned Unassigned
              akotha@atlassian.com Ashish Kotha
              Affected customers:
              7 This affects my team
              Watchers:
              25 Start watching this issue

                Created:
                Updated:
                Resolved: