| Summary: | LastCommitTimeStamp updated even when a serverSide Error occurred | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Pascal Lehmann <pascal.lehmann> | ||||||||||||||||||||||||||||||||
| Component: | cdo.core | Assignee: | Pascal Lehmann <pascal.lehmann> | ||||||||||||||||||||||||||||||||
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> | ||||||||||||||||||||||||||||||||
| Severity: | normal | ||||||||||||||||||||||||||||||||||
| Priority: | P3 | CC: | wim.bast | ||||||||||||||||||||||||||||||||
| Version: | 4.0 | ||||||||||||||||||||||||||||||||||
| Target Milestone: | --- | ||||||||||||||||||||||||||||||||||
| Hardware: | All | ||||||||||||||||||||||||||||||||||
| OS: | All | ||||||||||||||||||||||||||||||||||
| Whiteboard: | |||||||||||||||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||||||||||||||
|
Description
Pascal Lehmann
Created attachment 182203 [details]
Testcase
Created attachment 182208 [details]
Testcase v2
Testcase & config with proper imports :)
Created attachment 182282 [details]
Patch
I splitted creation and the actual set of the lastCommitTimeStamp into 2 operations, so setLastCommitTimeStamp won't be called when there is an exception thrown earlier in the write method of the TransactionCommitContext.
Created attachment 182547 [details]
Combined patch
I've fixed the test so tat it passes in legacy configs.
I wonder though whether the delayed setting of the commit timestamp can create new issues with long and short commits at the same time. Can we discuss that next week?
Created attachment 187448 [details]
Patch v3
This patch fixes the problem that clients fill up their outOfOrderInvalidations queue because of missing timestamps. For failed commits we now send a CommitNotificationRequest with a CDOCommitInfo that only contains the two timestamps. Especially the branch is null so that it can be recognized. This commit info "unlocks" the mentioned queue.
Committed revision 6920: - trunk/plugins/org.eclipse.emf.cdo.server - trunk/plugins/org.eclipse.emf.cdo - trunk/plugins/org.eclipse.emf.cdo.common Keeping bugzilla open because Pascal plans to write a specific tets case... Created attachment 187507 [details]
Patch B v1
I forgot to apply the same cure to the committing client. Funny this was even harder.
Committed revision 6926: - trunk/plugins/org.eclipse.emf.cdo - trunk/plugins/org.eclipse.emf.cdo.net4j - trunk/plugins/org.eclipse.emf.cdo.server.net4j Created attachment 187521 [details]
Testcase v3
Updated the testcase, holding now the following tests:
- Change on the same object (== Error & timestamp update on repo).
- Long running commit on objects of the same type.
- Long running commit on objects of different type.
The first test fails sometimes, also with the newest patch applied.
The last two always fail.
With my patch they seem to all run fine though.
Created attachment 187551 [details]
Testcase v4 (just reformatted sligtly)
(In reply to comment #10) > Created attachment 187521 [details] > Testcase v3 > > Updated the testcase, [...] Updated? I only see a new test class i the patch. > The first test fails sometimes, also with the newest patch applied. > The last two always fail. Yes, for me the last two fail. > With my patch they seem to all run fine though. Which one? The one from Nov., 3rd? I can't even apply that one anymore ;-( *** Bug 334659 has been marked as a duplicate of this bug. *** Created attachment 187613 [details] Updated patch (separation of timestamp generation & actual set) (In reply to comment #12) > (In reply to comment #10) > Updated? I only see a new test class i the patch. It was never committed, but there are already 2 versions posted :) > Which one? The one from Nov., 3rd? I can't even apply that one anymore ;-( Yes, that one. Interesting as it applies without problems here. I attached an updated version :) Created attachment 187647 [details]
patch v2
Removed the timestamp reset in case of an error.
Created attachment 187671 [details]
Patch v3 - ready to be committed
I've moved the call to setLastCommitTime() into the updateInfraStructure() method which is guaranteed to be called only after a successful call to accessor.commit().
Pascal, I've not looked again at Testcase v4, please feel free to commit it if it does not harm the test suites ;-) Committed revision 6942: - trunk/plugins/org.eclipse.emf.cdo.server - trunk/plugins/org.eclipse.emf.cdo.tests Testcase is included as well. I found a problem in CDOSessionImpl.invalidateOrdered(), so I could move back the timestamp to the createCommitTimestamp where it originally resided. Committed revision 6958: - trunk/plugins/org.eclipse.emf.cdo - trunk/plugins/org.eclipse.emf.cdo.server Committed revision 6960 (tests) There is still a problem with setting the CTS on the session wich produced the Error. So the test will fail whenever the session which the assert is checked against causes the error in the concurrent commit. Created attachment 187931 [details]
Testcase v5
Updated the testcase, so both directions are checked, no matter which commit thread (session) causes the Error.
just noticed that the error test case might pass when one of the commit threads was slow enough to already receive the invalidation of the other: you will receive the following client side error instead of the server error: org.eclipse.emf.cdo.util.CommitException: This transaction has conflicts I'll try to update the testcase once again :) Created attachment 188227 [details]
Patch v4
Suppressing *all* exceptions from write/commit on the server.
Created attachment 188228 [details]
Patch v5
Committed revision 7013 Created attachment 188250 [details]
Testcase v6
Fixed the first testcase logic (server side error on concurrent commit).
Thank you Pascal. I've committed it to kick a new build... BTW, I've changed DEFAULT_TIMEOUT_EXPECTED to DEFAULT_TIMEOUT. Or do we expect a timeout there? Committed revision 7015 (In reply to comment #29) > BTW, I've changed DEFAULT_TIMEOUT_EXPECTED to DEFAULT_TIMEOUT. Or do we expect > a timeout there? Not if the bug is fixed :) But to shorten the test cycles while developping the test I chose to use the 2sec timeout instead of the 2min timeout. Available in R20110608-1407 |