db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-5426) Improve the error raised by too much contention on a sequence/identity.
Date Thu, 22 Sep 2011 15:46:26 GMT

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

Rick Hillegas updated DERBY-5426:
---------------------------------

    Attachment: derby-5426-01-aa-improveError.diff

Attaching derby-5426-01-aa-improveError.diff. This patch improves error reporting for high
contention sequences/identities. I am running regression tests now.

This patch makes the following changes:

1) The "too much contention" message (X0Y84) now recommends that the user try adjusting the
two properties.

2) To clarify the code, error raising has been moved inside the retry loop in SequenceUpdater.getCurrentValueAndAdvance().

3) The two SequenceUpdaters now raise different exceptions when they have looped too long
trying to get the next value from the sequence generator. The sequence SequenceUpdater continues
to raise a "too much contention" exception just as it used to. The identity SequenceUpdater
now raises a "lock timeout" exception (40XL1) which wraps a "too much contention" exception.

Touches the following files:

M      java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java
M      java/engine/org/apache/derby/loc/messages.xml


> Improve the error raised by too much contention on a sequence/identity.
> -----------------------------------------------------------------------
>
>                 Key: DERBY-5426
>                 URL: https://issues.apache.org/jira/browse/DERBY-5426
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.8.2.1, 10.9.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-5426-01-aa-improveError.diff
>
>
> Currently, when there is too much contention on a sequence/identity, Derby raises an
error saying so. There are two properties which the user can adjust in order to reduce the
risk of this error:
> derby.locks.waitTimeout
> derby.language.sequence.preallocator
> It would be good to point the user at these knobs. The following change would improve
this error reporting:
> 1) Raise a lock timeout SQLException
> 2) Chain a "too much contention" SQLException (X0Y84) to the lock timeout.
> 3) Make the "too much contention" exception suggest that the user adjust the properties
mentioned above.
> To make the code easier to understand, the exception raising could replace the loop exit
inside the following "if" block in SequenceUpdater.getCurrentValueAndAdvance():
>             if (
>                 (_lockTimeoutInMillis >= 0L) &&
>                 ( (System.currentTimeMillis() - startTime.longValue()) > _lockTimeoutInMillis
)
>                 )
>             {
>                 break;
>             }
> This approach was recommended by the discussion on DERBY-5423.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message