Repository: asterixdb Updated Branches: refs/heads/master fec04f03d -> af85e2525
Fix sporadic failures in checkpoint test Change-Id: Ic32b9221ba3f843e006931556bab52d184ab1d33 Reviewed-on: https://asterix-gerrit.ics.uci.edu/1317 Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Reviewed-by: Ian Maxon <ima...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/af85e252 Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/af85e252 Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/af85e252 Branch: refs/heads/master Commit: af85e252545fa480a02d207347701c218f3b4ced Parents: fec04f0 Author: Murtadha Hubail <mhub...@uci.edu> Authored: Fri Oct 28 21:04:41 2016 +0300 Committer: Murtadha Hubail <hubail...@gmail.com> Committed: Fri Oct 28 14:52:00 2016 -0700 ---------------------------------------------------------------------- .../apache/asterix/test/logging/CheckpointingTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af85e252/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/logging/CheckpointingTest.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/logging/CheckpointingTest.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/logging/CheckpointingTest.java index e3932ca..679d96e 100644 --- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/logging/CheckpointingTest.java +++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/logging/CheckpointingTest.java @@ -30,6 +30,7 @@ import org.apache.asterix.common.configuration.AsterixConfiguration; import org.apache.asterix.common.configuration.Property; import org.apache.asterix.common.dataflow.AsterixLSMInsertDeleteOperatorNodePushable; import org.apache.asterix.common.transactions.DatasetId; +import org.apache.asterix.common.transactions.IRecoveryManager; import org.apache.asterix.common.transactions.ITransactionContext; import org.apache.asterix.external.util.DataflowUtils; import org.apache.asterix.metadata.entities.Dataset; @@ -123,13 +124,14 @@ public class CheckpointingTest { VSizeFrame frame = new VSizeFrame(ctx); FrameTupleAppender tupleAppender = new FrameTupleAppender(frame); + IRecoveryManager recoveryManager = nc.getTransactionSubsystem().getRecoveryManager(); LogManager logManager = (LogManager) nc.getTransactionSubsystem().getLogManager(); // Number of log files after node startup should be one int numberOfLogFiles = logManager.getLogFileIds().size(); Assert.assertEquals(1, numberOfLogFiles); // Low-water mark LSN - long lowWaterMarkLSN = nc.getTransactionSubsystem().getRecoveryManager().getMinFirstLSN(); + long lowWaterMarkLSN = recoveryManager.getMinFirstLSN(); // Low-water mark log file id long initialLowWaterMarkFileId = logManager.getLogFileId(lowWaterMarkLSN); // Initial Low-water mark should be in the only available log file @@ -142,7 +144,7 @@ public class CheckpointingTest { } // Check if the new low-water mark is still in the initial low-water mark log file - lowWaterMarkLSN = nc.getTransactionSubsystem().getRecoveryManager().getMinFirstLSN(); + lowWaterMarkLSN = recoveryManager.getMinFirstLSN(); long currentLowWaterMarkLogFileId = logManager.getLogFileId(lowWaterMarkLSN); if (currentLowWaterMarkLogFileId == initialLowWaterMarkFileId) { @@ -152,7 +154,7 @@ public class CheckpointingTest { * recovery) */ int numberOfLogFilesBeforeCheckpoint = logManager.getLogFileIds().size(); - nc.getTransactionSubsystem().getRecoveryManager().checkpoint(false, logManager.getAppendLSN()); + recoveryManager.checkpoint(false, logManager.getAppendLSN()); int numberOfLogFilesAfterCheckpoint = logManager.getLogFileIds().size(); Assert.assertEquals(numberOfLogFilesBeforeCheckpoint, numberOfLogFilesAfterCheckpoint); @@ -164,7 +166,7 @@ public class CheckpointingTest { while (currentLowWaterMarkLogFileId == initialLowWaterMarkFileId) { ITupleReference tuple = tupleGenerator.next(); DataflowUtils.addTupleToFrame(tupleAppender, tuple, insertOp); - lowWaterMarkLSN = nc.getTransactionSubsystem().getRecoveryManager().getMinFirstLSN(); + lowWaterMarkLSN = recoveryManager.getMinFirstLSN(); currentLowWaterMarkLogFileId = logManager.getLogFileId(lowWaterMarkLSN); } } @@ -173,7 +175,7 @@ public class CheckpointingTest { * At this point, the low-water mark is not in the initialLowWaterMarkFileId, so * a checkpoint should delete it. */ - nc.getTransactionSubsystem().getRecoveryManager().checkpoint(false, logManager.getAppendLSN()); + recoveryManager.checkpoint(false, recoveryManager.getMinFirstLSN()); // Validate initialLowWaterMarkFileId was deleted for (Long fileId : logManager.getLogFileIds()) {