Merge lp:~pbeaman/akiban-persistit/add-lock2 into lp:akiban-persistit

Proposed by Peter Beaman
Status: Merged
Approved by: Nathan Williams
Approved revision: 428
Merged at revision: 418
Proposed branch: lp:~pbeaman/akiban-persistit/add-lock2
Merge into: lp:akiban-persistit
Diff against target: 26 lines (+8/-7)
1 file modified
src/main/java/com/persistit/Transaction.java (+8/-7)
To merge this branch: bzr merge lp:~pbeaman/akiban-persistit/add-lock2
Reviewer Review Type Date Requested Status
Nathan Williams Approve
Review via email: mp+145976@code.launchpad.net

Description of the change

Make the status fields (e.g., _commitCompleted) volatile. Use of a Transaction instance is almost entirely thread-private, but the CLEANUP_MANAGER thread looks at the transaction state of Transaction instances that formerly belonged to now-ended threads. I believe a failure we are seeing in WriteSkewIT is caused by an intermittent failure to read that state coherently. Specifically, it is trying to run rollback on a Transaction that actually has already been rolled back (by its own thread), and that attempt is throwing an IllegalMonitorStateException for that reason.

To post a comment you must log in.
Revision history for this message
Nathan Williams (nwilliams) wrote :

Sounds plausible.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/main/java/com/persistit/Transaction.java'
--- src/main/java/com/persistit/Transaction.java 2012-11-30 20:33:30 +0000
+++ src/main/java/com/persistit/Transaction.java 2013-01-31 20:56:24 +0000
@@ -412,14 +412,15 @@
412 private final Persistit _persistit;412 private final Persistit _persistit;
413 private final SessionId _sessionId;413 private final SessionId _sessionId;
414 private final long _id;414 private final long _id;
415 private int _nestedDepth;415
416 private boolean _rollbackPending;416 private volatile int _nestedDepth;
417 private boolean _rollbackCompleted;417 private volatile boolean _rollbackPending;
418 private boolean _commitCompleted;418 private volatile boolean _rollbackCompleted;
419 private volatile boolean _commitCompleted;
419420
420 private long _rollbackCount = 0;421 private volatile long _rollbackCount = 0;
421 private long _commitCount = 0;422 private volatile long _commitCount = 0;
422 private int _rollbacksSinceLastCommit = 0;423 private volatile int _rollbacksSinceLastCommit = 0;
423424
424 private volatile TransactionStatus _transactionStatus;425 private volatile TransactionStatus _transactionStatus;
425 private volatile long _startTimestamp;426 private volatile long _startTimestamp;

Subscribers

People subscribed via source and target branches