Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 61729 invoked from network); 15 Oct 2007 09:12:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Oct 2007 09:12:43 -0000 Received: (qmail 97534 invoked by uid 500); 15 Oct 2007 09:12:31 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 97320 invoked by uid 500); 15 Oct 2007 09:12:30 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 97311 invoked by uid 99); 15 Oct 2007 09:12:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Oct 2007 02:12:30 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Oct 2007 09:12:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 29A7771420A for ; Mon, 15 Oct 2007 02:11:52 -0700 (PDT) Message-ID: <30313622.1192439512168.JavaMail.jira@brutus> Date: Mon, 15 Oct 2007 02:11:52 -0700 (PDT) From: =?utf-8?Q?J=C3=B8rgen_L=C3=B8land_=28JIRA=29?= To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3116) totalSpace not properly initialized in AllocPage In-Reply-To: <30993983.1191852410848.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3116?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534775 ]=20 J=C3=B8rgen L=C3=B8land commented on DERBY-3116: -------------------------------------- Hi Knut Anders. Patch d3116-1 looks correct to me, but it seems a little overkill to always= reinitiate the byte[] in StoredPage. Could you achieve the same thing by m= oving the initSpace call from StoredPage#usePageBuffer to StoredPage#create= Page? Alternatively make initSpace protected and call StoredPage#initSpace = from CachedPage#setPageArray when the page is reused? Another bug? In StoredPage#initSpace, slotEntrySize is used when setting ma= xFieldSize. However, initSpace is called before slotEntrySize has been upda= ted in usePageBuffer.=20 Not related to your patch: There is a problem with the Javadoc in AllocPage= (unclosed paragraph " totalSpace not properly initialized in AllocPage > ------------------------------------------------ > > Key: DERBY-3116 > URL: https://issues.apache.org/jira/browse/DERBY-3116 > Project: Derby > Issue Type: Bug > Components: Store > Affects Versions: 10.4.0.0 > Reporter: Knut Anders Hatlen > Priority: Minor > Attachments: d3116-1.diff > > > There are some problems with the initialization of totalSpace in AllocPag= e. It is initialized in StoredPage.initSpace() which is again called from S= toredPage.usePageBuffer(), and it is set to the value returned from AllocPa= ge.getMaxFreeSpace(). The problems are: > 1) The calculation in getMaxFreeSpace() uses borrowedSpace, but when cr= eateIdentity() is called on an AllocPage, borrowedSpace has not been initia= lized when getMaxFreeSpace() is called and the calculated size is wrong. > 2) When a page object is reused, usePageBuffer() is only called if a ne= w byte array must be allocated (because the new page has a different size t= han 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 corre= ct. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.