Issue Details (XML | Word | Printable)

Key: DERBY-4059
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Kathey Marsden
Reporter: Kathey Marsden
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby
DERBY-4054

If space reclamation cannot obtain container lock it will not retry getting the lock

Created: 16/Feb/09 05:15 PM   Updated: 04/May/09 06:22 PM
Component/s: Store
Affects Version/s: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.1.1
Fix Version/s: 10.5.1.1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works derby-4059_code_change_diff.txt 2009-02-17 07:22 PM Kathey Marsden 2 kB

Issue & fix info: Patch Available
Resolution Date: 19/Feb/09 08:09 PM
Labels:


 Description  « Hide
As noted in DERBY-4054 openContainerNW throws an exception if it canno get the container lock and bypasses the retry logic. See:
https://issues.apache.org/jira/browse/DERBY-4054?focusedCommentId=12673376#action_12673376

We should catch the exception and retry if we can't get the container lock. This probably won't fix the repro for DERBY-4054, but should be helpful in some user scenarios.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Kathey Marsden made changes - 16/Feb/09 10:42 PM
Field Original Value New Value
Assignee Kathey Marsden [ kmarsden ]
Kathey Marsden added a comment - 17/Feb/09 12:55 AM
I am trying to write a test where having the post commit retries will actually help, but am having trouble making a case. Even if I change ClobReclamationTest.xtestMultiThreadedUpdateTableLocking() to have each of the two threads update just two rows, it seems to give up after three retries. Is there any wait between retries of post commit actions or does it just loop through its todo list and retry when it is finished with its current queue?

Kathey Marsden added a comment - 17/Feb/09 07:22 PM
Attached is a patch for the code change so that we will retry if we can't get a container lock. I cannot however come up with a test case where it seems to make any difference. As I commented earlier, the retry seems to be too quick. I manually verified that we do retry and give up by setting derby.debug.true=DaemonTrace and looking at the derby.log.

I'd like to come up with a test case though where the retry helps before I check in.

Kathey Marsden made changes - 17/Feb/09 07:22 PM
Attachment derby-4059_code_change_diff.txt [ 12400349 ]
Kathey Marsden added a comment - 19/Feb/09 06:10 PM
After observing the behavior with the patch and chatting with Mike, I have come to the conclusion that the three retries is just really not sufficient. We will need to something else with the retries, either have some short wait instead of no wait when trying to get locks, up the retries or do something more elaborate like Mike suggested in this comment https://issues.apache.org/jira/browse/DERBY-4055?focusedCommentId=12673436#action_12673436

I think I will go ahead and check in this fix as is as it does enable retries when getting the container lock, even though those retries aren't very useful. It should make the code more consistent for whatever solution we settle on to fix this long term. I will add a comment to the code that three retries is likely not enough.





Kathey Marsden made changes - 19/Feb/09 06:16 PM
Derby Info [Patch Available]
Repository Revision Date User Message
ASF #745982 Thu Feb 19 20:09:16 UTC 2009 kmarsden DERBY-4059 If space reclamation cannot obtain container lock it will not retry getting the lock

This change does make the change so that the retry occurs but in practical application it is unlikely that we will get the lock after three retries, because the retry happens so quickly. See https://issues.apache.org/jira/browse/DERBY-4055?focusedCommentId=12673436#action_12673436 for suggestions on long term solutions to the retry problem.
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ReclaimSpaceHelper.java

Kathey Marsden made changes - 19/Feb/09 08:09 PM
Fix Version/s 10.5.0.0 [ 12313010 ]
Status Open [ 1 ] Closed [ 6 ]
Resolution Fixed [ 1 ]
Repository Revision Date User Message
ASF #749792 Tue Mar 03 22:10:41 UTC 2009 kmarsden DERBY-4059 If space reclamation cannot obtain container lock it will not retry getting the lock
Files Changed
MODIFY /db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/store/raw/data/ReclaimSpaceHelper.java

Repository Revision Date User Message
ASF #749839 Tue Mar 03 23:28:18 UTC 2009 kmarsden DERBY-4059 If space reclamation cannot obtain container lock it will not retry getting the lock
Files Changed
MODIFY /db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/data/ReclaimSpaceHelper.java

Repository Revision Date User Message
ASF #749872 Wed Mar 04 01:25:37 UTC 2009 kmarsden DERBY-4059 If space reclamation cannot obtain container lock it will not retry getting the lock
Files Changed
MODIFY /db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/data/ReclaimSpaceHelper.java

Repository Revision Date User Message
ASF #750071 Wed Mar 04 16:52:34 UTC 2009 kmarsden DERBY-4059 If space reclamation cannot obtain container lock it will not retry getting the lock
Files Changed
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/ReclaimSpaceHelper.java

Myrna van Lunteren made changes - 04/May/09 06:22 PM
Affects Version/s 10.5.1.1 [ 12313771 ]
Affects Version/s 10.5.0.0 [ 12313010 ]
Fix Version/s 10.5.1.1 [ 12313771 ]
Fix Version/s 10.5.0.0 [ 12313010 ]