Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion persistit/core/src/test/java/com/persistit/MVCCPruneTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Portions Copyrighted 2026 3A Systems, LLC
*/

package com.persistit;
Expand Down Expand Up @@ -253,6 +254,15 @@ public void testPruneAlternatingAbortedAndCommittedVersions() throws PersistitEx
storePrimordial(ex1, KEY, VALUE);

for (int i = 0; i < VERSIONS.length; ++i) {
/*
* The prune that runs inside each store consults the active
* transaction cache: a stale cache conservatively keeps the
* previous committed version, a fresh one removes it. Settle the
* cache before every store so the surviving version count does
* not depend on whether the background TXN_UPDATE timer fired
* mid-loop (issue #272).
*/
_persistit.getTransactionIndex().updateActiveTransactionCache();
trx1.begin();
try {
store(ex1, KEY, VALUE + VERSIONS[i] + i);
Expand All @@ -265,7 +275,7 @@ public void testPruneAlternatingAbortedAndCommittedVersions() throws PersistitEx
trx1.end();
}
}
final int VERSIONS_NOW_REMOVED_BY_PRUNING_BEFORE_STORE = 2;
final int VERSIONS_NOW_REMOVED_BY_PRUNING_BEFORE_STORE = 4;
assertEquals("stored versions", VERSIONS.length + 1 - VERSIONS_NOW_REMOVED_BY_PRUNING_BEFORE_STORE,
storedVersionCount(ex2, KEY));

Expand Down
Loading