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

error on sql when upgrading database from 10.2.2 to 10.4.1.3

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.4.1.3
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      None
    • Environment:
      AS400 V5R3
    • Bug behavior facts:
      Data corruption

      Description

      I upgraded a 10.2.2 database to 10.4.1.3 on the AS400 V5R3 and when I try to access a large table, derby throws this error.

      select max(column) from table;

      ERROR XSDG0: Page Page(86673,Container(0, 4432)) could not be read from disk.
      ERROR XJ001: Java exception: 'The value specified for the argument is not correct. Read/write failed: java.io.IOException'.

      In derby.log
      ERROR XSDG0: Page Page(86673,Container(0, 4432)) could not be read from disk.
      at java.lang.Throwable.<init>(Throwable.java:195)
      at java.lang.Exception.<init>(Exception.java:41)
      at org.apache.derby.iapi.error.StandardException.<init>(Unknown Source)
      at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
      at org.apache.derby.impl.store.raw.data.CachedPage.readPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.CachedPage.setIdentity(Unknown Source)
      at org.apache.derby.impl.services.cache.CachedItem.takeOnIdentity(Unknown Source)
      at org.apache.derby.impl.services.cache.Clock.addEntry(Unknown Source)
      at org.apache.derby.impl.services.cache.Clock.find(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.getAllocPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseContainer.getAllocPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getAllocPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.AllocationCache.validate(Unknown Source)
      at org.apache.derby.impl.store.raw.data.AllocationCache.getLastPageNumber(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.pageValid(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.getUserPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.getPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getPage(Unknown Source)
      at org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.readConglomerate(Unknown Source)
      at org.apache.derby.impl.store.access.RAMAccessManager.conglomCacheFind(Unknown Source)
      at org.apache.derby.impl.store.access.RAMTransaction.findExistingConglomerate(Unknown Source)
      at org.apache.derby.impl.store.access.RAMTransaction.openStoreCost(Unknown Source)
      at org.apache.derby.impl.sql.compile.CompilerContextImpl.getStoreCostController(Unknown Source)
      at org.apache.derby.impl.sql.compile.FromBaseTable.getStoreCostController(Unknown Source)
      at org.apache.derby.impl.sql.compile.FromBaseTable.estimateCost(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.estimateTotalCost(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.costBasedCostOptimizable(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.costOptimizable(Unknown Source)
      at org.apache.derby.impl.sql.compile.FromBaseTable.optimizeIt(Unknown Source)
      at org.apache.derby.impl.sql.compile.ProjectRestrictNode.optimizeIt(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.costPermutation(Unknown Source)
      at org.apache.derby.impl.sql.compile.SelectNode.optimize(Unknown Source)
      at org.apache.derby.impl.sql.compile.DMLStatementNode.optimizeStatement(Unknown Source)
      at org.apache.derby.impl.sql.compile.CursorNode.optimizeStatement(Unknown Source)
      at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
      at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
      at org.apache.derby.tools.ij.main(Unknown Source)
      Caused by: java.io.IOException: The value specified for the argument is not correct. Read/write failed
      at java.lang.Throwable.<init>(Throwable.java:195)
      at java.lang.Exception.<init>(Exception.java:41)
      at java.io.IOException.<init>(IOException.java:40)
      at sun.nio.ch.FileDispatcher.pread0(Native Method)
      at sun.nio.ch.FileDispatcher.pread(FileDispatcher.java:60)
      at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:230)
      at sun.nio.ch.IOUtil.read(IOUtil.java:206)
      at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:617)
      at org.apache.derby.impl.store.raw.data.RAFContainer4.readFull(Unknown Source)
      at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage0(Unknown Source)
      at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.CachedPage.readPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.CachedPage.setIdentity(Unknown Source)
      at org.apache.derby.impl.services.cache.CachedItem.takeOnIdentity(Unknown Source)
      at org.apache.derby.impl.services.cache.Clock.addEntry(Unknown Source)
      at org.apache.derby.impl.services.cache.Clock.find(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.getAllocPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseContainer.getAllocPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getAllocPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.AllocationCache.validate(Unknown Source)
      at org.apache.derby.impl.store.raw.data.AllocationCache.getLastPageNumber(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.pageValid(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.getUserPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.getPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getPage(Unknown Source)
      at org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.readConglomerate(Unknown Source)
      at org.apache.derby.impl.store.access.RAMAccessManager.conglomCacheFind(Unknown Source)
      at org.apache.derby.impl.store.access.RAMTransaction.findExistingConglomerate(Unknown Source)
      at org.apache.derby.impl.store.access.RAMTransaction.openStoreCost(Unknown Source)
      at org.apache.derby.impl.sql.compile.CompilerContextImpl.getStoreCostController(Unknown Source)
      at org.apache.derby.impl.sql.compile.FromBaseTable.getStoreCostController(Unknown Source)
      at org.apache.derby.impl.sql.compile.FromBaseTable.estimateCost(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.estimateTotalCost(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.costBasedCostOptimizable(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.costOptimizable(Unknown Source)
      at org.apache.derby.impl.sql.compile.FromBaseTable.optimizeIt(Unknown Source)
      at org.apache.derby.impl.sql.compile.ProjectRestrictNode.optimizeIt(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.costPermutation(Unknown Source)
      at org.apache.derby.impl.sql.compile.SelectNode.optimize(Unknown Source)
      at org.apache.derby.impl.sql.compile.DMLStatementNode.optimizeStatement(Unknown Source)
      at org.apache.derby.impl.sql.compile.CursorNode.optimizeStatement(Unknown Source)
      at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
      at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
      ============= begin nested exception, level (1) ===========
      java.io.IOException: The value specified for the argument is not correct. Read/write failed
      at java.lang.Throwable.<init>(Throwable.java:195)
      at java.lang.Exception.<init>(Exception.java:41)
      at java.io.IOException.<init>(IOException.java:40)
      at sun.nio.ch.FileDispatcher.pread0(Native Method)
      at sun.nio.ch.FileDispatcher.pread(FileDispatcher.java:60)
      at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:230)
      at sun.nio.ch.IOUtil.read(IOUtil.java:206)
      at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:617)
      at org.apache.derby.impl.store.raw.data.RAFContainer4.readFull(Unknown Source)
      at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage0(Unknown Source)
      at org.apache.derby.impl.store.raw.data.RAFContainer4.readPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.CachedPage.readPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.CachedPage.setIdentity(Unknown Source)
      at org.apache.derby.impl.services.cache.CachedItem.takeOnIdentity(Unknown Source)
      at org.apache.derby.impl.services.cache.Clock.addEntry(Unknown Source)
      at org.apache.derby.impl.services.cache.Clock.find(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.getAllocPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseContainer.getAllocPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getAllocPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.AllocationCache.validate(Unknown Source)
      at org.apache.derby.impl.store.raw.data.AllocationCache.getLastPageNumber(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.pageValid(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.getUserPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.FileContainer.getPage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getPage(Unknown Source)
      at org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.readConglomerate(Unknown Source)
      at org.apache.derby.impl.store.access.RAMAccessManager.conglomCacheFind(Unknown Source)
      at org.apache.derby.impl.store.access.RAMTransaction.findExistingConglomerate(Unknown Source)
      at org.apache.derby.impl.store.access.RAMTransaction.openStoreCost(Unknown Source)
      at org.apache.derby.impl.sql.compile.CompilerContextImpl.getStoreCostController(Unknown Source)
      at org.apache.derby.impl.sql.compile.FromBaseTable.getStoreCostController(Unknown Source)
      at org.apache.derby.impl.sql.compile.FromBaseTable.estimateCost(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.estimateTotalCost(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.costBasedCostOptimizable(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.costOptimizable(Unknown Source)
      at org.apache.derby.impl.sql.compile.FromBaseTable.optimizeIt(Unknown Source)
      at org.apache.derby.impl.sql.compile.ProjectRestrictNode.optimizeIt(Unknown Source)
      at org.apache.derby.impl.sql.compile.OptimizerImpl.costPermutation(Unknown Source)
      at org.apache.derby.impl.sql.compile.SelectNode.optimize(Unknown Source)
      at org.apache.derby.impl.sql.compile.DMLStatementNode.optimizeStatement(Unknown Source)
      at org.apache.derby.impl.sql.compile.CursorNode.optimizeStatement(Unknown Source)
      at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
      at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
      ============= end nested exception, level (1) ===========

      I noticed that one of the datafile is over 8 GB. Does the newer version of derby have a problem with large files? I will try 10.4.2.0 to see if the same problem exists.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tttran1 Trung Tran
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: