Merge lp:~nwilliams/akiban-persistit/handle-abandoned-txn-status into lp:akiban-persistit
Proposed by
Nathan Williams
Status: | Merged |
---|---|
Approved by: | Peter Beaman |
Approved revision: | 428 |
Merged at revision: | 423 |
Proposed branch: | lp:~nwilliams/akiban-persistit/handle-abandoned-txn-status |
Merge into: | lp:akiban-persistit |
Diff against target: |
308 lines (+174/-31) 5 files modified
src/main/java/com/persistit/Persistit.java (+12/-26) src/main/java/com/persistit/Transaction.java (+1/-0) src/main/java/com/persistit/TransactionIndexBucket.java (+3/-5) src/main/java/com/persistit/TransactionStatus.java (+28/-0) src/test/java/com/persistit/TransactionAbandonedTest.java (+130/-0) |
To merge this branch: | bzr merge lp:~nwilliams/akiban-persistit/handle-abandoned-txn-status |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nathan Williams | Needs Resubmitting | ||
Akiban Build User | Needs Fixing | ||
Review via email: mp+149643@code.launchpad.net |
Description of the change
Fix closing of transactions from threads that have been abandoned.
If a thread is abandoned with an open transaction the wwLock member of TransactionStatus will be in a locked state. See associated bug for more details.
This isn't easily recoverable as the thread holding the lock is now gone. The only reason it needs to be unlocked is for re-use, mark it as abandoned and throw it away when it is no longer needed.
Minor cleanup and helper usage to eliminate duplicate code.
Includes simple test case and one requiring MVV cleanup.
To post a comment you must log in.
From cell phone, so it's hard to Approve. But it looks fine to me so please
go ahead. Alternatively I was thinking about replacing the lock object and
allowing the ts to be recycled. Either way is fine with me. Good detective
work!
On Feb 20, 2013 12:38 PM, "Nathan Williams" <email address hidden> wrote:
> Nathan Williams has proposed merging technologies) xBucket# allocateTransac tionStatus" /bugs.launchpad .net/akiban- persistit/ +bug/1126297 /code.launchpad .net/~nwilliams /akiban- persistit/ handle- abandoned- txn-status/ +merge/ 149643 /code.launchpad .net/~nwilliams /akiban- persistit/ handle- abandoned- txn-status/ +merge/ 149643 java/com/ persistit/ Persistit. java' java/com/ persistit/ Persistit. java 2013-02-15 15:39:42 +0000 java/com/ persistit/ Persistit. java 2013-02-20 17:37:24 +0000 ssionMap) { SessionId> (_transactionSe ssionMap. keySet( )); isAlive( )) { ssionMap) { sionMap. remove( sessionId) ; close() ; exception. log(e); sactions( ); Volume> (_volumes) ; java/com/ persistit/ Transaction. jav...
> lp:~nwilliams/akiban-persistit/handle-abandoned-txn-status into
> lp:akiban-persistit.
>
> Requested reviews:
> Akiban Technologies (akiban-
> Related bugs:
> Bug #1126297 in Akiban Persistit: "Assertion failure in
> TransactionInde
> https:/
>
> For more details, see:
>
> https:/
>
> Fix closing of transactions from threads that have been abandoned.
>
> If a thread is abandoned with an open transaction the wwLock member of
> TransactionStatus will be in a locked state. See associated bug for more
> details.
>
> This isn't easily recoverable as the thread holding the lock is now gone.
> The only reason it needs to be unlocked is for re-use, mark it as abandoned
> and throw it away when it is no longer needed.
>
> Minor cleanup and helper usage to eliminate duplicate code.
>
> Includes simple test case and one requiring MVV cleanup.
> --
>
> https:/
> Your team Akiban Technologies is requested to review the proposed merge of
> lp:~nwilliams/akiban-persistit/handle-abandoned-txn-status into
> lp:akiban-persistit.
>
> === modified file 'src/main/
> --- src/main/
> +++ src/main/
> @@ -1496,26 +1496,12 @@
> return _bufferPoolTable;
> }
>
> + /**
> + * Remove any sessions that have expired and close transactions
> associated
> + * with them. Also flush statistics for all known volumes.
> + */
> void cleanup() {
> - final Set<SessionId> sessionIds;
> - synchronized (_transactionSe
> - sessionIds = new
> HashSet<
> - }
> - for (final SessionId sessionId : sessionIds) {
> - if (!sessionId.
> - Transaction transaction = null;
> - synchronized (_transactionSe
> - transaction =
> _transactionSes
> - }
> - if (transaction != null) {
> - try {
> - transaction.
> - } catch (final PersistitException e) {
> - _logBase.
> - }
> - }
> - }
> - }
> + closeZombieTran
> final List<Volume> volumes;
> synchronized (this) {
> volumes = new ArrayList<
>
> === modified file 'src/main/