Merge lp:~pbeaman/akiban-persistit/test-plan-review-1 into lp:akiban-persistit

Proposed by Peter Beaman
Status: Merged
Approved by: Peter Beaman
Approved revision: 384
Merged at revision: 385
Proposed branch: lp:~pbeaman/akiban-persistit/test-plan-review-1
Merge into: lp:akiban-persistit
Diff against target: 195 lines (+42/-39)
6 files modified
doc/ReleaseNotes.rst (+2/-2)
src/main/java/com/persistit/Buffer.java (+5/-1)
src/main/java/com/persistit/Exchange.java (+4/-13)
src/main/java/com/persistit/JournalManager.java (+0/-4)
src/main/java/com/persistit/Persistit.java (+29/-14)
src/main/java/com/persistit/TransactionIndex.java (+2/-5)
To merge this branch: bzr merge lp:~pbeaman/akiban-persistit/test-plan-review-1
Reviewer Review Type Date Requested Status
Akiban Build User Needs Fixing
Nathan Williams Approve
Review via email: mp+131680@code.launchpad.net

Description of the change

Several very small corrections/edits based on code-review:

Typos in the release notes.

Buffer#dump should use same IV format as journal.
synchronize around various clear() methods in Persistit#releaseAllResources to ensure visibility in other threads (eliminate a possible cause for occasional failure of unit tests to release all resources.

Remove a dead method.

Retry loop in Exchange now actually decrements the retry counter.

Remove return unnecessary return value from addOrCombineDelta.

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

Looks good.

review: Approve
Revision history for this message
Akiban Build User (build-akiban) wrote :

There was one failure during build/test:

* unknown exception (check log)

review: Needs Fixing
Revision history for this message
Nathan Williams (nwilliams) wrote :

LBJ timeout.

Revision history for this message
Akiban Build User (build-akiban) wrote :

There were 2 failures during build/test:

* job persistit-build failed at build number 467: http://172.16.20.104:8080/job/persistit-build/467/

* view must-pass failed: persistit-build is yellow

review: Needs Fixing
Revision history for this message
Peter Beaman (pbeaman) wrote :

Very interesting. The failed test appears to have created a deadlock, which may be an instance of elusive bug I am looking for. I do not believe the changes in this proposal have anything to do with it, so I'm re-A-pproving this again, but will also try to reproduce the deadlock.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/ReleaseNotes.rst'
2--- doc/ReleaseNotes.rst 2012-10-15 21:22:32 +0000
3+++ doc/ReleaseNotes.rst 2012-10-26 19:53:26 +0000
4@@ -80,7 +80,7 @@
5 Persistit 3.2.0 - Default Journal File Format Changed
6 -----------------------------------------------------
7
8-Version 3.2.0 fixes problems related to Volumes created and opened by the com.persistit#loadVolume
9+Version 3.2.0 fixes problems related to Volumes created and opened by the com.persistit.Persistit#loadVolume
10 method rather than being specified by the initial system configuration. In previous versions, journal files
11 contained insufficient information to properly recover such volumes, even during normal startup.
12
13@@ -150,7 +150,7 @@
14 volume from an existing Database, this change provides a configurable switch to optionally
15 allow pages from missing volumes to be skipped (with logged warning messages) during recovery
16 processing. The switch can be enabled by setting the configuration parameter
17-com.persistit.Configuration#setIgnoreMissingViolumes to true.
18+com.persistit.Configuration#setIgnoreMissingVolumes to true.
19
20
21 Persistit 3.1.4 - Reduce KeyCoder Serialized Object Size
22
23=== modified file 'src/main/java/com/persistit/Buffer.java'
24--- src/main/java/com/persistit/Buffer.java 2012-10-03 14:43:25 +0000
25+++ src/main/java/com/persistit/Buffer.java 2012-10-26 19:53:26 +0000
26@@ -4268,7 +4268,11 @@
27 IV.putHandle(bb, volumeHandle);
28 IV.putVolumeId(bb, volume.getId());
29 IV.putTimestamp(bb, 0);
30- IV.putVolumeSpecification(bb, volume.getName());
31+ if (_persistit.getConfiguration().isUseOldVSpec()) {
32+ IV.putVolumeSpecification(bb, volume.getName());
33+ } else {
34+ IV.putVolumeSpecification(bb, volume.getSpecification().toString());
35+ }
36 bb.position(bb.position() + IV.getLength(bb));
37 identifiedVolumes.add(volume);
38 }
39
40=== modified file 'src/main/java/com/persistit/Exchange.java'
41--- src/main/java/com/persistit/Exchange.java 2012-10-15 19:21:18 +0000
42+++ src/main/java/com/persistit/Exchange.java 2012-10-26 19:53:26 +0000
43@@ -585,14 +585,6 @@
44 }
45 }
46
47- /**
48- * Re-save the current buffer generation. Can only be used when all
49- * other data (key gens, foundAt, etc) is still valid.
50- */
51- private void updateBufferGeneration() {
52- _bufferGeneration = _buffer.getGeneration();
53- }
54-
55 private Sequence sequence(final int foundAt) {
56 final int delta = ((foundAt & P_MASK) - (_lastInsertAt & P_MASK));
57 if ((foundAt & EXACT_MASK) == 0 && delta == KEYBLOCK_LENGTH) {
58@@ -1160,8 +1152,7 @@
59 pageAddress = buffer.getPointer(p);
60
61 Debug.$assert0.t(pageAddress > 0 && pageAddress < MAX_VALID_PAGE_ADDR);
62- }/** TODO -- dead code **/
63- else {
64+ } else {
65 oldBuffer = buffer; // So it will be released
66 corrupt("Volume " + _volume + " level=" + currentLevel + " page=" + pageAddress + " key=<"
67 + key.toString() + ">" + " page type=" + buffer.getPageType() + " is invalid");
68@@ -1346,7 +1337,7 @@
69
70 final int maxSimpleValueSize = maxValueSize(key.getEncodedSize());
71 final Value spareValue = _persistit.getThreadLocalValue();
72- assert !(doMVCC & value == spareValue || doFetch && value == _spareValue) : "storeInternal may be use the supplied Value: "
73+ assert !(doMVCC & value == spareValue || doFetch && value == _spareValue) : "storeInternal may use the supplied Value: "
74 + value;
75
76 //
77@@ -1492,7 +1483,7 @@
78 if (doMVCC) {
79 valueToStore = spareValue;
80 final int valueSize = value.getEncodedSize();
81- final int retries = VERSIONS_OUT_OF_ORDER_RETRY_COUNT;
82+ int retries = VERSIONS_OUT_OF_ORDER_RETRY_COUNT;
83
84 for (;;) {
85 try {
86@@ -1558,7 +1549,7 @@
87 }
88 break;
89 } catch (final VersionsOutOfOrderException e) {
90- if (retries <= 0) {
91+ if (--retries <= 0) {
92 throw e;
93 }
94 }
95
96=== modified file 'src/main/java/com/persistit/JournalManager.java'
97--- src/main/java/com/persistit/JournalManager.java 2012-10-08 19:48:22 +0000
98+++ src/main/java/com/persistit/JournalManager.java 2012-10-26 19:53:26 +0000
99@@ -2221,10 +2221,6 @@
100
101 return super.getPollInterval() / divisor;
102 }
103-
104- void setShouldStop(final boolean shouldStop) {
105- _shouldStop = shouldStop;
106- }
107 }
108
109 private class JournalFlusher extends IOTaskRunnable {
110
111=== modified file 'src/main/java/com/persistit/Persistit.java'
112--- src/main/java/com/persistit/Persistit.java 2012-10-10 16:06:49 +0000
113+++ src/main/java/com/persistit/Persistit.java 2012-10-26 19:53:26 +0000
114@@ -1837,20 +1837,35 @@
115 _logFlusher.interrupt();
116 }
117 _logFlusher = null;
118- _accumulators.clear();
119- _volumes.clear();
120- _exchangePoolMap.clear();
121- _cleanupManager.clear();
122- _transactionSessionMap.clear();
123- _cliSessionMap.clear();
124- _sessionIdThreadLocal.remove();
125- _fatalErrors.clear();
126- _alertMonitors.clear();
127- _bufferPoolTable.clear();
128- _intArrayThreadLocal.set(null);
129- _keyThreadLocal.set(null);
130- _valueThreadLocal.set(null);
131- _initialized.set(false);
132+ /*
133+ * The following are synchronized to ensure visibility
134+ */
135+ synchronized (_accumulators) {
136+ _accumulators.clear();
137+ }
138+ synchronized (this) {
139+ _volumes.clear();
140+ _alertMonitors.clear();
141+ _bufferPoolTable.clear();
142+ _intArrayThreadLocal.set(null);
143+ _keyThreadLocal.set(null);
144+ _valueThreadLocal.set(null);
145+ _initialized.set(false);
146+ _sessionIdThreadLocal.remove();
147+ _cleanupManager.clear();
148+ }
149+ synchronized (_exchangePoolMap) {
150+ _exchangePoolMap.clear();
151+ }
152+ synchronized (_transactionSessionMap) {
153+ _transactionSessionMap.clear();
154+ }
155+ synchronized (_cliSessionMap) {
156+ _cliSessionMap.clear();
157+ }
158+ synchronized (_fatalErrors) {
159+ _fatalErrors.clear();
160+ }
161 }
162
163 /**
164
165=== modified file 'src/main/java/com/persistit/TransactionIndex.java'
166--- src/main/java/com/persistit/TransactionIndex.java 2012-09-12 20:07:07 +0000
167+++ src/main/java/com/persistit/TransactionIndex.java 2012-10-26 19:53:26 +0000
168@@ -1142,17 +1142,15 @@
169 * Step value of modification.
170 * @param value
171 * The value to add or combine.
172- *
173- * @return Delta that was created or modified.
174 */
175- Delta addOrCombineDelta(final TransactionStatus status, final Accumulator accumulator, final int step,
176+ void addOrCombineDelta(final TransactionStatus status, final Accumulator accumulator, final int step,
177 final long value) {
178 // Check current deltas, no lock as status is single txn/thread
179 Delta delta = status.getDelta();
180 while (delta != null) {
181 if (delta.canMerge(accumulator, step)) {
182 delta.merge(value);
183- return null;
184+ return;
185 }
186 delta = delta.getNext();
187 }
188@@ -1161,7 +1159,6 @@
189 delta.setAccumulator(accumulator);
190 delta.setStep(step);
191 delta.setValue(value);
192- return delta;
193 }
194
195 /*

Subscribers

People subscribed via source and target branches