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 "Rick Hillegas (JIRA)" <ji...@apache.org> on 2010/03/03 18:12:27 UTC

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

     [ https://issues.apache.org/jira/browse/DERBY-4565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-4565:
---------------------------------

    Attachment: derby-4565-01-ad-firstRev.diff

Attaching derby-4565-01-ad-firstRev.diff. This is a test client for testing the concurrency of sequence generators.

Using this test client I am able to force a pile-up on a sequence generator with the following command. The pile-up consists of "too much contention" exceptions whenever the sequence generator is queried for a new value:

java org.apache.derbyTesting.perf.clients.Runner \
    -driver org.apache.derby.jdbc.EmbeddedDriver \
    -init \
    -load seq_gen \
    -load_opts debugging=0,numberOfGenerators=5,tablesPerGenerator=10,insertsPerTransaction=100 \
    -gen b2b \
    -threads 10 \

Increasing the size of the pre-allocated sequence range does not prevent pile-ups. I can eliminate the pile-ups by increasing the number of times that a frustrated thread retries its attempt to grab a sequence number. That is, the pile-ups disappear when I set SequenceUpdater.RETRY_COUNT = 100. With that modification, I still see occasional "too much contention" exceptions, but the threads do not pile-up.

A variation on this solution, might be to eliminate the RETRY_COUNT and, instead, to let the threads keep retrying until they have exceeded the derby.locks.waitTimeout period. Or there may be some other modification we could make to the sequence generator.

This patch does not change the behavior of Derby. The patch simply introduces a new concurrency test.

Touches the following files:

-------------

M      java/testing/org/apache/derbyTesting/perf/clients/Runner.java
A      java/testing/org/apache/derbyTesting/perf/clients/SequenceGeneratorConcurrency.java

The new client for testing concurrent use of sequence generators.

-------------

M      java/testing/org/apache/derbyTesting/perf/clients/PoissonLoadGenerator.java
M      java/testing/org/apache/derbyTesting/perf/clients/Client.java
M      java/testing/org/apache/derbyTesting/perf/clients/SingleRecordSelectClient.java
M      java/testing/org/apache/derbyTesting/perf/clients/BankTransactionClient.java
M      java/testing/org/apache/derbyTesting/perf/clients/SingleRecordUpdateClient.java
M      java/testing/org/apache/derbyTesting/perf/clients/IndexJoinClient.java
M      java/testing/org/apache/derbyTesting/perf/clients/GroupByClient.java
M      java/testing/org/apache/derbyTesting/perf/clients/BackToBackLoadGenerator.java

Added a new reporting method so that, on exit, the load generators can print client-specific statistics.


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