You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/03/04 12:06:27 UTC

[jira] Commented: (DERBY-4565) Create concurrency test to stress sequence generators.

    [ 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.