Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 72259 invoked from network); 9 Oct 2007 12:03:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Oct 2007 12:03:50 -0000 Received: (qmail 59154 invoked by uid 500); 9 Oct 2007 12:03:38 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 59117 invoked by uid 500); 9 Oct 2007 12:03:37 -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 59108 invoked by uid 99); 9 Oct 2007 12:03:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2007 05:03:37 -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; Tue, 09 Oct 2007 12:03:41 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 05D6F71420E for ; Tue, 9 Oct 2007 05:02:51 -0700 (PDT) Message-ID: <13979857.1191931371021.JavaMail.jira@brutus> Date: Tue, 9 Oct 2007 05:02:51 -0700 (PDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-3099) Possible bug in interaction with buffer manager causing pages not to be freed on rollback to savepoint In-Reply-To: <18939083.1191401810717.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-3099: -------------------------------------- Attachment: initSpace.diff I think I found the problem. I extended the toString() methods in the page classes so that they printed all the fields, and then I noticed that the maxFieldSize field was different too. This field is initialized in StoredPage.initSpace() and depends on the value of slotEntrySize. initSpace() is called from StoredPage.usePageBuffer() which also initializes slotEntrySize. However, slotEntrySize is not initialized until after initSpace() has been called, so the value seen in initSpace() is old and possibly incorrect. The attached patch delays the call to initSpace() until slotEntrySize is properly initialized. This made T_RawStoreFactory run successfully with the buffer manager changes that made it fail before. > Possible bug in interaction with buffer manager causing pages not to be freed on rollback to savepoint > ------------------------------------------------------------------------------------------------------ > > Key: DERBY-3099 > URL: https://issues.apache.org/jira/browse/DERBY-3099 > Project: Derby > Issue Type: Bug > Components: Services, Store > Affects Versions: 10.4.0.0 > Reporter: Knut Anders Hatlen > Attachments: failfast.diff, initSpace.diff > > > I noticed this strange behaviour when I was working on DERBY-2911. It seems like the result of test case P042 in unit/T_RawStoreFactory.unit is dependent on the actual contents of the buffer manager (which pages have been evicted, which free entries have been reused and so on). I'm not sure if this is a bug in the test or somewhere in the code, or if this is expected behaviour, but it sounds a bit suspicious. > For instance, commenting out all the test cases preceeding P042 makes P042 fail, even though P042 creates a new container so that it should not be affected by any of the previous test cases. Also, commenting out a space optimization in Clock.findFreeItem() so that freed entries are not reused except when rotateClock() is called on a full cache to find a victim, causes the test case to fail. A third way to make it fail, is to vary the scan direction when looking for a free entry to reuse in the new buffer manager (ConcurrentCache). If the scan is disabled or walks the clock from the beginning to the end, the test fails, but if the clock is scanned backwards, it passes. > The code that fails in the test, is > c = t_util.t_openContainer(t, segment, cid, true); > Page checkNextPage = t_util.t_addPage(c); > if (checkNextPage.getPageNumber() == nextPageNumber) > throw T_Fail.testFailMsg( > "expect some pages to be freed by update rollback"); > The expected page number is 2, and the actual page number is 7. > Before this, a large row has been inserted on page 1 and overflows to page 2, 3, 4, 5 and 6. Also, page 7 has been added manually before all the updates were rolled back so that the pages from 2 up to 7 should be unallocated. Page 7 is then added and removed, and the transaction is committed. After reopening the container, the test expects the pages from 2 up to 7 to be free, and that t_addPage() should allocate page number 2. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.