db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-2197) Remove unused code for locking rows while holding a latch
Date Fri, 22 Dec 2006 13:42:23 GMT
     [ http://issues.apache.org/jira/browse/DERBY-2197?page=all ]

Knut Anders Hatlen updated DERBY-2197:
--------------------------------------

    Attachment: derby-2197-engine.diff
                derby-2197-engine.stat

I'm attaching a patch (derby-2197-engine.diff) for feedback. It is not ready
for commit yet since many of the storeunit tests won't build with it. All of
the engine code builds.

The patch makes the following changes to the engine code:

  1) Removes LockFactory.lockObject(..., Latch) and its implementation in
     SinglePool.

  2) Removes LockingPolicy.lockRecordForRead(Latch, ...) and
     LockingPolicy.lockRecordForWrite(Latch, ...) and all their
     implementations.

  3) Removes Page.fetch(), Page.update() and Page.delete() and their
     implementations in BasePage.

  4) The only caller of Page.update() (GenericScanController.replace()) has
     been rewritten to use Page.updateAtSlot(), and an assert has been added to
     check whether row locking is needed.

  5) The only caller of Page.delete() (BTreeScan.delete()) has been rewritten
     to use Page.deleteAtSlot(), and an assert has been added to check whether
     row locking is needed.

Since many of the storeunit tests invoke some of the deleted methods directly,
they won't compile. I have therefore tested the patch by building (sane) engine
jars and using derbyTesting.jar from a clean trunk. The results from the
testing showed no errors in the JUnit tests and 25 errors in derbyall. All of
the errors in derbyall were storeunit tests which tried to invoke the deleted
methods.

I'm not sure how to proceed with the storeunit tests. The removed methods are
used many places, and the tests are not always clear on what they are
testing. I guess I could write some utility methods in T_Util which did some
locking/latching tricks around Page.updateAtSlot/deleteAtSlot/fetchFromSlot.

Comments on the approach I used in the patch and bright ideas on how to fix the
storeunit tests would be greatly appreciated! Thanks.

> Remove unused code for locking rows while holding a latch
> ---------------------------------------------------------
>
>                 Key: DERBY-2197
>                 URL: http://issues.apache.org/jira/browse/DERBY-2197
>             Project: Derby
>          Issue Type: Improvement
>          Components: Store, Test, Services
>    Affects Versions: 10.3.0.0
>            Reporter: Knut Anders Hatlen
>         Assigned To: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: derby-2197-engine.diff, derby-2197-engine.stat
>
>
> Some of the code for locking a row while holding a latch doesn't seem to be used outside
the unit tests for store. This code should be removed in order to reduce the overall complexity.
See the discussion in DERBY-2107 for details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message