Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-7156

ERROR XSDAO: Internal error: Page attempted latched twice when executing parallel accesses to the same binary column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 10.15.1.3, 10.15.2.0, 10.16.1.1
    • None
    • Store
    • None
    • OS name: Windows 10
      OS architecture: amd64
      OS version: 10.0
      Java Version: 17.0.7
      Java Vendor: Eclipse Adoptium
    • Normal
    • Repro attached
    • Crash, Seen in production

    Description

      When executing parallel SELECT statements accessing to a table with a binary column, sometimes an error indicating that a page was attempted latched twice is received while reading the value of the binary column.

       

      This error ERROR XSDAO: Internal error: page Page(334,Container(0, 1456)) attempted latched twice is received when connection is inside a transaction.

      In case the connection is not in a transaction, the error is different: ERROR 40XD0: Container has been closed

       

      I attach a Java class for reproducing the issue. It has the following lines for testing both versions of the error

      //conn.setAutoCommit(true); //ERROR 40XD0: Container has been closed.
      conn.setAutoCommit(false); //ERROR XSDAO: Internal error: page Page(334,Container(0, 1392)) attempted latched twice. 

      This is an example of the received error.

       

      Exception in thread "pool-1-thread-1" java.lang.RuntimeException: java.io.IOException: ERROR XSDAO: Internal error: page Page(334,Container(0, 1456)) attempted latched twice.
          at org.scruz.derby.TestTx$Access.run(TestTx.java:60)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
          at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.io.IOException: ERROR XSDAO: Internal error: page Page(334,Container(0, 1456)) attempted latched twice.
          at org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(OverflowInputStream.java:168)
          at org.apache.derby.impl.store.raw.data.BufferedByteHolderInputStream.read(BufferedByteHolderInputStream.java:37)
          at java.base/java.io.FilterInputStream.read(FilterInputStream.java:82)
          at java.base/java.io.FilterInputStream.read(FilterInputStream.java:82)
          at java.base/java.io.FilterInputStream.read(FilterInputStream.java:82)
          at org.apache.derby.iapi.services.io.CloseFilterInputStream.read(CloseFilterInputStream.java:60)
          at org.scruz.derby.TestTx$Access.run(TestTx.java:55)
          ... 3 more
      Caused by: ERROR XSDAO: Internal error: page Page(334,Container(0, 1456)) attempted latched twice.
          at org.apache.derby.shared.common.error.StandardException.newException(StandardException.java:300)
          at org.apache.derby.shared.common.error.StandardException.newException(StandardException.java:295)
          at org.apache.derby.impl.store.raw.data.BasePage.setExclusive(BasePage.java:1710)
          at org.apache.derby.impl.store.raw.data.BaseContainer.latchPage(BaseContainer.java:527)
          at org.apache.derby.impl.store.raw.data.FileContainer.latchPage(FileContainer.java:3532)
          at org.apache.derby.impl.store.raw.data.FileContainer.getUserPage(FileContainer.java:2551)
          at org.apache.derby.impl.store.raw.data.FileContainer.getPage(FileContainer.java:2593)
          at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getPage(BaseContainerHandle.java:319)
          at org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(OverflowInputStream.java:151)
          ... 9 more

       

      Attachments

        1. TestTx.java
          4 kB
          Sergio Cruz
        2. sysinfo.txt
          2 kB
          Sergio Cruz
        3. derby.log
          0.7 kB
          Sergio Cruz

        Activity

          People

            Unassigned Unassigned
            scruz Sergio Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: