public class RecoveryTest extends Object
| Constructor and Description |
|---|
RecoveryTest() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
addEntry(com.gemstone.gemfire.cache.Region aRegion)
Add a new entry to the given region.
|
protected void |
addEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Add a new entry to the given region.
|
protected void |
cacheRegionOperations()
Method to exercise Cache.rootRegions and Cache.getRegion(String).
|
protected static void |
checkForLastIteration()
Check if we have run for the desired length of time.
|
protected void |
clearAllRegions() |
protected com.gemstone.gemfire.cache.Region |
clearRegion()
Invoke region.clear() - only one region is cleared during any test run.
|
protected void |
concRecoverLatestResponder()
Do randon operations and wait for the controller to signal it's time to write
a snapshot to the blackboard.
|
protected static void |
deleteDir(File aDir)
Recursively delete a directory and its contents
|
protected static void |
deleteExistingDiskDirs()
Delete existing disk directories if they contain disk files.
|
protected void |
destroyAllEntries() |
protected void |
destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalDestroy)
Destroy an entry in the given region.
|
protected void |
destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean isLocalDestroy)
Destroy an entry in the given region.
|
protected static void |
doOfflineValAndCompaction() |
protected void |
doOperations(long msToRun)
Do random operations on the cache and any defined regions in this vm.
|
protected void |
getExistingKey(com.gemstone.gemfire.cache.Region aRegion)
Does a get operation on an existing key.
|
protected void |
getNewKey(com.gemstone.gemfire.cache.Region aRegion)
Get a new key int the given region.
|
protected Object[] |
getNonPartitionedRegionInfo()
Return an array of nonPartitionedRegionInfo where
Object[0] = selected region (null if there are no non-partitioned regions in the test)
Object[1] = total number of non-partitioned regions.
|
protected int |
getOperation(Long whichPrm)
Get a random operation using the given hydra parameter.
|
protected int |
getOperation(com.gemstone.gemfire.cache.Region aRegion)
Get an operation to perform on the region
|
protected Map |
getPutAllMap(com.gemstone.gemfire.cache.Region aRegion)
Get a map to use for putAll for the given region.
|
protected static String |
getRegionCreatedKey(int vmID,
String regionName)
Return a key to be used in the blackboard to indicate that a member
created a particular region.
|
protected void |
getThisNewKey(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Do a get on the given new key.
|
protected Object |
getUpdateObject(com.gemstone.gemfire.cache.Region r,
String key)
Return an object to be used to update the given key.
|
static String |
getXmlFileName(int vmID)
Return the xml file name for the vm with the given ID.
|
protected static boolean |
hasDiskInitFile(String diskStoreName,
File[] diskDirArr) |
static void |
HydraTask_addGatewayHub()
Create gateway hub
|
static void |
HydraTask_backupController()
Task to control the backupResponder vms.
|
static void |
HydraTask_backupResponder()
Task to do random operations and direct other vms to pause and create snapshots.
|
static void |
HydraTask_compactionController()
Hydra task to run the compaction controller thread.
|
static void |
HydraTask_compactionResponder()
Hydra task to run the responder threads for compaction tests.
|
static void |
HydraTask_concRecoverAllController()
For concurrent recovery tests that stop all vms concurrently.
|
static void |
HydraTask_concRecoverLatestController()
For concurrent recovery tests, control when vms are stopped and restarted
and create blackboard information for verification.
|
static void |
HydraTask_concRecoverLatestResponder()
For concurrent recovery tests, respond to the concRecoverLatestController
|
static void |
HydraTask_convertPre65Controller() |
static void |
HydraTask_convertPre70Controller() |
static void |
HydraTask_convertVerifyFromSnapshot()
Verify all regions from the snapshot and wait for all threads to complete verify
|
static void |
HydraTask_convertVerifyFromSnapshotAndSync()
Verify all regions from the snapshot and wait for all threads to complete verify
|
static void |
HydraTask_convertWANTestController()
Run from a new version locator thread
This code is hardcoded for 3 wan sites because of a time crunch to get
the test running.
|
static void |
HydraTask_convertWANTestResponder()
Run from a new version locator thread
This code is hardcoded for 3 wan sites because of a time crunch to get
the test running.
|
static void |
HydraTask_createExtraRegions()
Create extra root regions.
|
static void |
HydraTask_createGatewayHub()
Create gateway hub
|
static void |
HydraTask_createLocator() |
static void |
HydraTask_createRegions()
Create a region for each region defined in hydra.RegionPrms-names
|
static void |
HydraTask_createRegionsConvertedFirst()
Create a region for each region defined in hydra.RegionPrms-names
|
static void |
HydraTask_createXmlFile()
Hydra task to create an xml file for all regions currently existing
|
static void |
HydraTask_disconnect()
Disconnect from the distributed system
|
static void |
HydraTask_diskConvOperationsController()
Task to control the operationsResponder vms.
|
static void |
HydraTask_diskConvOperationsResponder()
Task to do random operations and direct other vms to pause and create snapshots.
|
static void |
HydraTask_doOnlineBackup() |
static void |
HydraTask_doOperations()
Task to do random operations
|
static void |
HydraTask_doOperationsHA()
Task to do random operations that expect exceptions from shutDownAllMembers
|
static void |
HydraTask_doOperationsShutDownAll()
Task to do random operations that expect exceptions from shutDownAllMembers
|
static void |
HydraTask_doOperationsWithPause()
Task to do random operations and pause then the controller thread signals
pausing by incrementing the pausing counter.
|
static void |
HydraTask_doRecovery()
Stop all members and restart to do disk recovery
|
static void |
HydraTask_doSingleConvert()
Convert disk files for this jvm.
|
static void |
HydraTask_importAndVerify()
Verify all regions from the snapshot after choosing 1 vm to import the snapshot
|
static void |
HydraTask_initialize()
Creates and initializes a server or peer.
|
static void |
HydraTask_initializeClient()
Creates and initializes an edge client.
|
static void |
HydraTask_initializeController()
Initialization for controller for compaction test.
|
static void |
HydraTask_latestRecoveryTest()
Hydra task to verify that the latest disk files are recovered.
|
static void |
HydraTask_load()
Hydra task to load the region(s) with keys/values.
|
static void |
HydraTask_logRegions()
Task to log the sizes of all regions.
|
static void |
HydraTask_markVmInBlackboard()
Hydra task to mark this vm in the blackboard with a string.
|
static void |
HydraTask_multiRegionInitialize()
Initialization for test that run with multi-regions and multi-diskStores
|
static void |
HydraTask_operationsController()
Task to control the operationsResponder vms.
|
static void |
HydraTask_operationsResponder()
Task to do random operations and direct other vms to pause and create snapshots.
|
static void |
HydraTask_prepareForNewVersionOps()
set each newVersion uniqueKey blackboard value to a value higher
than was used in the oldVersion ops to ensure unique keys and
that new keys obtained by newVersion vms have never been used
by oldVersion vms
|
static void |
HydraTask_recordStartupState()
Record disk startup state to the blackboard for later validation
|
static void |
HydraTask_recoverAfterGiiTest()
Serial execution test that steps back and forth between two vms to verify
that the disk files are updated when initialized from gii and can be used for
recovery
|
static void |
HydraTask_resetUniqueKeyIndex()
Reset the uniqueKeyIndex to be higher than the current blackboard counter
|
static void |
HydraTask_restoreBackups()
Hydra task to restore each backup that occurred during the run.
|
static void |
HydraTask_rvvConvert()
Execute conversion from pre-7.0 to 7.0 (RVV), but only one
thread in the test can do the conversion.
|
static void |
HydraTask_rvvConvertOperationsController()
Controller for rvv (7.0) conversion test.
|
static void |
HydraTask_rvvConvertOperationsResponder()
Task to do random operations and direct other vms to pause and create snapshots.
|
static void |
HydraTask_rvvConvertVerifyFromSnapshot()
Verify all regions from the snapshot and wait for all threads to complete verify
|
static void |
HydraTask_rvvConvertVerifyFromSnapshotAndSync()
Verify all regions from the snapshot and wait for all threads to complete verify
|
static void |
HydraTask_rvvConvertWANTestController()
Run from a new version locator thread
This code is hardcoded for 3 wan sites because of a time crunch to get
the test running.
|
static void |
HydraTask_rvvConvertWANTestResponder()
Run from the oldVersionPublisher thread
This code is hardcoded for 3 wan sites because of a time crunch to get
the test running.
|
static void |
HydraTask_snapshotController()
Task to control the snapshotResponder vms.
|
static void |
HydraTask_snapshotResponder()
Task to do random operations, writeSnapshot, export then import snapshot and verify
|
static void |
HydraTask_startGatewayHub()
Start gateway hub
|
static void |
HydraTask_startLocatorAndDS() |
static void |
HydraTask_stopGatewayHub()
Disconnect from the distributed system
|
static void |
HydraTask_tombstoneTestController()
This is run by one vm to control responder vms for reaping tomstone tests.
|
static void |
HydraTask_tombstoneTestResponder()
Responds to directives issued by the tombstone test controller
|
static void |
HydraTask_upgradeController()
Controller method to test uprade of disk files one release to another.
|
static void |
HydraTask_verifyDeltaGII()
Verify if initialized remotely (via gii) verify that we used deltaGII if expected.
|
static void |
HydraTask_verifyEmptyRegions()
Verify that all regions are empty
|
static void |
HydraTask_verifyFromLeaderSnapshot()
Verify all regions from the snapshot after choosing 1 vm to write its
state to the blackboard.
|
static void |
HydraTask_verifyFromSnapshot()
Verify all regions from the snapshot
|
static void |
HydraTask_verifyFromSnapshotAndSync()
Verify all regions from the snapshot and wait for all threads to complete verify
|
static void |
HydraTask_verifyPRs()
Verify regions that are PRs
|
static void |
HydraTask_verifyRegions()
Verify the expected sizes of all regions
|
static void |
HydraTask_verifyStartupState()
Verify that each vm got it's data from disk or gii as appropriate
|
static void |
HydraTask_waitForMyStartupRecovery()
For all PRs, wait for startup recovery in this VM.
|
static void |
HydraTask_writeSnapshot() |
static void |
HydraTask_writeToBB()
Write a snapshot to the blackboard for all regions except any
extra regions.
|
protected void |
invalidateEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalInvalidate)
Invalidate an entry in the given region.
|
protected void |
invalidateEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean isLocalInvalidate)
Invalidate an entry in the given region.
|
protected boolean |
isClearedRegion(com.gemstone.gemfire.cache.Region aRegion)
Whether or not the given Region was the target of a Region.clear().
|
protected static long |
logExecutionNumber()
Log the execution number of this serial task.
|
protected Object |
obtainExistingKey(com.gemstone.gemfire.cache.Region aRegion)
Return a random key from aRegion
|
protected List<String> |
obtainExistingKeys(com.gemstone.gemfire.cache.Region aRegion,
int numToObtain)
Return a random key from aRegion
|
protected Object |
obtainNewKey()
Return a new key, never before used in the test.
|
protected void |
putAll(com.gemstone.gemfire.cache.Region aRegion)
putall a map to the given region.
|
static void |
putsForKeyOrderPolicy(com.gemstone.gemfire.cache.Region aRegion)
Puts ValueHolders with sequentially increasing modVal into the cache
Does 1000 sequential updates on a single entry in the given region.
|
protected static void |
recoverLatestController() |
protected static String |
regionHierarchyToString()
Return a string representation of the region hierarchy for this test.
|
protected static void |
registerInterest()
Register interest with ALL_KEYS, and InterestPolicyResult = KEYS_VALUES
which is equivalent to a full GII.
|
protected static void |
runRestoreScript(File backupDir,
boolean expectSuccess)
Find restore scripts for any online backups that were done during
the run and execute the scripts.
|
static void |
rvvConvert()
Run the 7.0 conversion method.
|
static void |
rvvConvert(List<String> oldXmlFiles,
List<String> newXmlFiles) |
protected static void |
rvvConvert(String diskStoreName,
File[] diskDirArr)
Given a diskStoreName and an array of disk directories:
1) run the offline validator
2) run the offline conversion utility (7.0 RVV)
3) run the offline validator again
then check that the validator returns the same results before and
after the conversion.
|
protected void |
updateEntry(com.gemstone.gemfire.cache.Region aRegion)
Update an existing entry in the given region.
|
protected void |
updateEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Update an existing entry in the given region.
|
protected void |
validateAfterRestore(long backupNum)
After a restore from a backup, validate all region data.
|
protected void |
verifyAllRegionsEmpty() |
protected void |
verifyFromSnapshot()
For each region written to the blackboard, verify its state against the region
in this vm.
|
void |
verifyFromSnapshot(com.gemstone.gemfire.cache.Region aRegion,
Map regionSnapshot)
Verify that the given region is consistent with the given snapshot.
|
public static RecoveryTest testInstance
protected List<com.gemstone.gemfire.cache.Region> allRegions
protected AtomicInteger readyForSnapshot
protected static HydraThreadLocal threadIsPaused
public static final String oldVersionXmlKey
public static final String newVersionXmlKey
protected static final int ENTRY_ADD_OPERATION
protected static final int ENTRY_DESTROY_OPERATION
protected static final int ENTRY_INVALIDATE_OPERATION
protected static final int ENTRY_LOCAL_DESTROY_OPERATION
protected static final int ENTRY_LOCAL_INVALIDATE_OPERATION
protected static final int ENTRY_UPDATE_OPERATION
protected static final int ENTRY_GET_OPERATION
protected static final int ENTRY_GET_NEW_OPERATION
protected static final int ENTRY_PUTALL_OPERATION
protected static final int CACHE_OPERATIONS
protected static final int PUTS_FOR_KEY_ORDER_POLICY
protected static final int CLEAR_REGION
protected static final String getCallbackPrefix
protected static final String createCallbackPrefix
protected static final String updateCallbackPrefix
protected static final String invalidateCallbackPrefix
protected static final String destroyCallbackPrefix
protected static final String regionInvalidateCallbackPrefix
protected static final String regionDestroyCallbackPrefix
public static void HydraTask_createLocator()
throws Throwable
Throwablepublic static void HydraTask_startLocatorAndDS()
throws Throwable
Throwablepublic static void HydraTask_initializeClient()
throws Throwable
Throwablepublic static void HydraTask_initialize()
throws Throwable
Throwablepublic static void HydraTask_initializeController()
public static void HydraTask_multiRegionInitialize()
throws Throwable
Throwablepublic static void HydraTask_createXmlFile()
public static void HydraTask_load()
public static void HydraTask_compactionController()
public static void HydraTask_compactionResponder()
public static void HydraTask_latestRecoveryTest()
throws ClientVmNotFoundException,
InterruptedException
public static void HydraTask_recordStartupState()
public static void HydraTask_verifyRegions()
public static void HydraTask_verifyStartupState()
public static void HydraTask_markVmInBlackboard()
public static void HydraTask_verifyEmptyRegions()
public static void HydraTask_concRecoverLatestController()
public static void HydraTask_concRecoverLatestResponder()
public static void HydraTask_verifyFromSnapshot()
public static void HydraTask_writeSnapshot()
public static void HydraTask_verifyFromSnapshotAndSync()
public static void HydraTask_convertVerifyFromSnapshotAndSync()
public static void HydraTask_convertVerifyFromSnapshot()
public static void HydraTask_concRecoverAllController()
public static void HydraTask_verifyFromLeaderSnapshot()
public static void HydraTask_doOperations()
throws Exception
Exceptionpublic static void HydraTask_doOperationsWithPause()
throws Exception
Exceptionpublic static void HydraTask_doOperationsShutDownAll()
throws Exception
Exceptionpublic static void HydraTask_doOperationsHA()
throws Exception
Exceptionpublic static void HydraTask_backupController()
public static void HydraTask_backupResponder()
throws Exception
Exceptionpublic static void HydraTask_doRecovery()
public static void HydraTask_operationsController()
public static void HydraTask_operationsResponder()
throws Exception
Exceptionpublic static void HydraTask_snapshotController()
public static void HydraTask_snapshotResponder()
throws Exception
Exceptionpublic static void HydraTask_diskConvOperationsController()
public static void HydraTask_diskConvOperationsResponder()
throws Exception
Exceptionpublic static void HydraTask_recoverAfterGiiTest()
throws Exception
Exceptionpublic static void HydraTask_logRegions()
public static void HydraTask_createExtraRegions()
public static void HydraTask_createRegions()
public static void HydraTask_createGatewayHub()
public static void HydraTask_addGatewayHub()
public static void HydraTask_startGatewayHub()
public static void HydraTask_createRegionsConvertedFirst()
public static void HydraTask_writeToBB()
public static void HydraTask_disconnect()
public static void HydraTask_stopGatewayHub()
public static void HydraTask_doSingleConvert()
public static void HydraTask_verifyPRs()
public static void HydraTask_waitForMyStartupRecovery()
public static void HydraTask_convertPre65Controller()
public static void HydraTask_upgradeController()
public static void HydraTask_resetUniqueKeyIndex()
public static void HydraTask_prepareForNewVersionOps()
public static void HydraTask_convertWANTestController()
public static void HydraTask_convertWANTestResponder()
throws Exception
Exceptionpublic static void HydraTask_restoreBackups()
throws Exception
Exceptionprotected void validateAfterRestore(long backupNum)
throws Exception
backupNum - The backup number we restored from (backups are created
in directories called backup_Exceptionprotected static String regionHierarchyToString()
protected static void recoverLatestController()
protected void concRecoverLatestResponder()
protected void verifyFromSnapshot()
public void verifyFromSnapshot(com.gemstone.gemfire.cache.Region aRegion,
Map regionSnapshot)
aRegion - The region to verifysnapshot - The expected contents of aRegion.public static void HydraTask_importAndVerify()
protected void doOperations(long msToRun)
throws Exception
msToRun - The number of milliseconds to run operations before returning.Exceptionprotected int getOperation(com.gemstone.gemfire.cache.Region aRegion)
reg - The region to get an operation for.protected int getOperation(Long whichPrm)
whichPrm - A hydra parameter which specifies random operations.protected void getExistingKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to perform the get on.protected Object addEntry(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for adding a new entry.protected void addEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
aRegion - The region to use for adding a new entry.key - The key to add.protected void putAll(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for putall a map.protected Map getPutAllMap(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to consider for the putAll.protected void invalidateEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalInvalidate)
aRegion - The region to use for invalidating an entry.isLocalInvalidate - True if the invalidate should be local, false otherwise.protected void invalidateEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean isLocalInvalidate)
aRegion - The region to use for invalidating an entry.key - The key to invalidate.isLocalInvalidate - True if the invalidate should be local, false otherwise.protected void destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalDestroy)
aRegion - The region to use for destroying an entry.isLocalDestroy - True if the destroy should be local, false otherwise.protected void destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean isLocalDestroy)
aRegion - The region to use for destroying an entry.key - The key to destroy.isLocalDestroy - True if the destroy should be local, false otherwise.protected void updateEntry(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for updating an entry.protected void updateEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
aRegion - The region to use for updating an entry.key - The key to update.protected void getNewKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for getting an entry.protected void getThisNewKey(com.gemstone.gemfire.cache.Region aRegion,
Object key)
aRegion - The region to use for getting an entry.key - A new key never used before.protected Object obtainExistingKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to get the existing key from.protected List<String> obtainExistingKeys(com.gemstone.gemfire.cache.Region aRegion, int numToObtain)
aRegion - The region to get the existing key from.protected void cacheRegionOperations()
public static void putsForKeyOrderPolicy(com.gemstone.gemfire.cache.Region aRegion)
protected com.gemstone.gemfire.cache.Region clearRegion()
protected Object[] getNonPartitionedRegionInfo()
protected boolean isClearedRegion(com.gemstone.gemfire.cache.Region aRegion)
protected static void runRestoreScript(File backupDir, boolean expectSuccess)
backupDir - The directory containing a backup.expectSuccess - If true then the restore scripts should work
successfully, if false then they should fail because there
are already disk files present.protected static void deleteDir(File aDir)
aDir - The directory to delete.protected static void deleteExistingDiskDirs()
protected static void registerInterest()
protected static long logExecutionNumber()
protected static void checkForLastIteration()
protected Object obtainNewKey()
protected Object getUpdateObject(com.gemstone.gemfire.cache.Region r, String key)
aRegion - The region which possible contains key.key - The key to get a new value for.protected static String getRegionCreatedKey(int vmID, String regionName)
vmID - The vmID that created the region.regionName - The name of the region created.public static String getXmlFileName(int vmID)
public static void HydraTask_rvvConvertOperationsController()
public static void HydraTask_rvvConvertOperationsResponder()
throws Exception
Exceptionpublic static void HydraTask_convertPre70Controller()
public static void HydraTask_rvvConvertVerifyFromSnapshotAndSync()
public static void HydraTask_rvvConvertVerifyFromSnapshot()
public static void HydraTask_rvvConvertWANTestController()
public static void HydraTask_rvvConvertWANTestResponder()
throws Exception
Exceptionpublic static void HydraTask_rvvConvert()
public static void rvvConvert()
protected static void rvvConvert(String diskStoreName, File[] diskDirArr)
diskStoreName - The name of a diskStore.diskDirArr - An array of Files, each element being a disk directory.public static void HydraTask_doOnlineBackup()
protected static void doOfflineValAndCompaction()
public static void HydraTask_tombstoneTestController()
public static void HydraTask_tombstoneTestResponder()
protected void verifyAllRegionsEmpty()
protected void destroyAllEntries()
protected void clearAllRegions()
public static void HydraTask_verifyDeltaGII()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.