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

totalSpace not properly initialized in AllocPage

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.4.1.3
    • Fix Version/s: 10.4.1.3, 10.5.1.1
    • Component/s: Store
    • Labels:
      None

      Description

      There are some problems with the initialization of totalSpace in AllocPage. It is initialized in StoredPage.initSpace() which is again called from StoredPage.usePageBuffer(), and it is set to the value returned from AllocPage.getMaxFreeSpace(). The problems are:

      1) The calculation in getMaxFreeSpace() uses borrowedSpace, but when createIdentity() is called on an AllocPage, borrowedSpace has not been initialized when getMaxFreeSpace() is called and the calculated size is wrong.

      2) When a page object is reused, usePageBuffer() is only called if a new byte array must be allocated (because the new page has a different size than the old page). This means that the totalSize field gets the same value as in the old page if their sizes are equal, which is not necessarily correct.

        Attachments

        1. d3116-2.diff
          2 kB
          Knut Anders Hatlen
        2. d3116-1.diff
          1 kB
          Knut Anders Hatlen

          Activity

            People

            • Assignee:
              knutanders Knut Anders Hatlen
              Reporter:
              knutanders Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: