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] Commented: (DERBY-4565) Create concurrency test to stress sequence generators.
Date Thu, 04 Mar 2010 11:06:27 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841184#action_12841184
] 

Knut Anders Hatlen commented on DERBY-4565:
-------------------------------------------

Hi Rick,

I see these "too much contention" exceptions too. The current retry count of 3 sounds somewhat
low, as I can easily imagine that one threads comes in and grabs the entire pre-allocated
range of 5 values (somewhat low too?) before the other thread manages to get one. I don't
know how many times in a row it is reasonable to expect this to happen, so although I agree
that it should be increased, I have no idea how much we should increase it.

It would of course be better if we could get rid of the "too much contention" exceptions altogether.
The need for allocating a new range is detected inside a synchronized block in SequenceGenerator.
Is it possible to make that code only let one thread go ahead and allocate a new range, and
tell the other threads to hold their horses until that thread has done its work?

I added some extra instrumentation in SequenceUpdater.updateCurrentValueOnDisk() and saw that
it quite frequently needed to do the update in the main transaction instead of the nested
transaction. In fact, this happened more often than the "too much contention" exceptions in
my environment. These could also contribute to the thread pile-up you saw. If we managed to
get SequenceGenerator limit the number of threads that attempted to update the same generator
on disk, it would also reduce the chances of having to escalate the update operation to the
main transaction.

> Create concurrency test to stress sequence generators.
> ------------------------------------------------------
>
>                 Key: DERBY-4565
>                 URL: https://issues.apache.org/jira/browse/DERBY-4565
>             Project: Derby
>          Issue Type: Task
>          Components: SQL, Test
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4565-01-ad-firstRev.diff
>
>
> Create a concurrency test to find bottlenecks and bugs in sequence generators.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message