public static class TestRWJournal.TestRawStore extends AbstractRestartSafeTestCase
AbstractRestartSafeTestCase
.TestCase2.MyProperties, TestCase2.RandomType
r
_randomType, log
Constructor and Description |
---|
TestRWJournal.TestRawStore() |
TestRWJournal.TestRawStore(String name) |
Modifier and Type | Method and Description |
---|---|
int |
doStressCommitIndex(long retention,
int runs) |
protected BufferMode |
getBufferMode() |
Properties |
getProperties()
Reads in the configuration properties for the test from a
variety of resources and returns a properties hierarchy.
|
protected IRawStore |
getSmallSlotStore() |
protected IRawStore |
getSmallSlotStore(int slotSize) |
protected IRawStore |
getSmallSlotStore(int slotSize,
int nWasteAllocators,
float maxWaste) |
protected IRawStore |
getStore()
Return a new store that will serve as the fixture for the test.
|
protected Journal |
getStore(long retentionMillis) |
void |
notest_stress_alloc_performance()
Test to determine that allocation performance does not degrade at scale.
|
void |
notest_stressReallocationWithReadAndReopen() |
void |
test_addressing()
Ensures the allocation of unique addresses by mapping allocated
address with uniqueness assertion against physical address.
|
void |
test_addressingContiguous()
Ensures the allocation of unique addresses by mapping allocated
address with uniqueness assertion against physical address.
|
void |
test_allocate_then_read()
Test allocate()+read() where the record was never written (the data
are undefined unless written so there is nothing really to test here
except for exceptions which might be through for this condition).
|
void |
test_allocationContexts()
From a RWStore, creates multiple AllocationContexts to isolate
updates, re-allocate storage and protect against by concurrent
Contexts.
|
void |
test_allocations()
Basic allocation test to ensure the FixedAllocators are operating
efficiently.
|
void |
test_allocBlobBoundariesCommitFreeCommitWithHistory() |
void |
test_allocBlobCommitFreeCommitWithHistory() |
void |
test_allocCommitFree()
State1
Allocate - Commit - Free
assert that allocation remains committed
|
void |
test_allocCommitFreeCommit()
State2
Allocate - Commit - Free - Commit
assert that allocation is no longer committed
|
void |
test_allocCommitFreeCommitAllocSessionWriteCache()
State5
Allocate - Commit - Free - Commit
Tracks writeCache state through allocation
|
void |
test_allocCommitFreeCommitSessionWriteCache()
State4
Allocate - Commit - Free - Commit
..but with session protection using a RawTx
|
void |
test_allocCommitFreeCommitWithHistory()
In order to see deferred recycling we need to make two
commits (with modifications) after the retention period
has expired.
|
void |
test_allocCommitFreeCommitWriteCache()
State3
Allocate - Commit - Free - Commit
Tracks writeCache state through allocation
|
void |
test_allocCommitFreeCommitWriteCacheWithHistory() |
void |
test_allocCommitFreeWithHistory() |
void |
test_blob_allocs()
Test of blob allocation, does not check on read back, just the
allocation
|
void |
test_blob_readBack()
Test of blob allocation and read-back, firstly from cache and then
from disk.
|
void |
test_blob_realloc()
Test of blob allocation and read-back, firstly from cache and then
from disk.
|
void |
test_blobDeferredFrees()
This test releases over a blobs worth of deferred frees
|
void |
test_commitState()
Verify that we correctly restore the RWStore commit state if
RWStore.commit() is followed by RWStore.reset()
rather than RWStore.postCommit() . |
void |
test_commitStateError()
Test verifies that a failure to retain the commit state in
RWStore.commit() will cause problems if the write set is
discarded by RWStore.reset() such that subsequent write sets
run into persistent addressing errors. |
void |
test_commitStateIllegal()
Verify that a double-commit causes an illegal state exception.
|
void |
test_isolatedReset()
Tests semantics of a simple isolated reset
Commit some data
UnIsolated: Delete committed and allocate new data
Isolated: Delete committed and allocate new data
Reset
Test that deletion and new allocation are void for
unisolated actions but not isolated
|
void |
test_metaAlloc() |
void |
test_multiVoidCommit() |
void |
test_notSoSimpleIsolatedReset()
Tests semantics of a more complex isolated reset
Primarily the same as the simple isolated but ensuring
more unisolated interactions after isolation is
established.
|
void |
test_pureAlloc()
The pureAlloc test is to test the allocation aspect of the memory
management rather than worrying about writing the data
|
void |
test_reallocate()
Reallocates the same object several times, then commits and tests
read back.
|
void |
test_reallocation()
Reallocation tests the freeing of allocated address and the re-use
within a transaction.
|
void |
test_reallocationWithReadAndReopen() |
void |
test_reopenReset()
Tests semantics of a simple reset after reopen to emulate
an HAJournal reopen
As for simple reset but also re-open, then write and abort.
|
void |
test_sessionProtection()
Tests whether tasks are able to access and modify data safely by
emulating transactions by calling activateTx and deactivateTx
directly.
|
void |
test_simpleConcurrentReadersWithResets()
Concurrent readers should no longer be an issue now that
reset() is not re-initializing from the root block.
|
void |
test_simpleReset()
Tests semantics of a simple reset
Commit some data
Delete committed and allocate new data
Reset
Test that deletion and new allocation are void
|
void |
test_smallSlotRecycling()
Tests the recycling of small slot alloctors and outputs statistics related
to contiguous allocations indicative of reduced IOPS.
|
void |
test_smallSlotWasteRecylcing()
At scale the small slot handling can lead to large amounts of store
waste, tending to the small slot allocation thresholds of 50%,
dependent on use case.
|
void |
test_snapshotData() |
void |
test_stressAlloc() |
void |
test_stressBlobBlobHeaderBlobDataDeferredFrees()
Repeats the BlobBlobHeader of deferred frees, but also with blob data.
|
void |
test_stressBlobBlobHeaderDeferredFrees()
This test releases over a blobs worth of deferred frees where the
blob requires a blob header.
|
void |
test_stressBlobDeferredFrees()
This is the test that was able to reproduce the recycler failure for
BLZG-1236 when run with 10M deferred frees.
|
void |
test_stressBlobReadBack() |
void |
test_stressCommit() |
void |
test_stressCommitIndexNoRetention() |
void |
test_stressCommitIndexWithRetention() |
void |
test_stressReallocationWithRead()
Adjust tcount to increase stress levels
|
void |
test_stressSessionProtection()
To stress the session protection, we will allocate a batch of
addresses, then free half with protection.
|
void |
test_write_flush_update()
Ttest write() + flush() + update() - for this case the data have been
flushed from the write cache so the update will be a random write on
the file rather than being buffered by the write cache.
|
void |
testAllocationContexts() |
void |
testAllocationReserves()
Not so much a test as a code coverage exercise.
|
void |
testResetHARootBlock() |
void |
testSimpleReplication()
Test low level RWStore add/removeAddress methods as used in HA
WriteCache replication to ensure Allocation consistency
|
void |
testSimpleReset() |
void |
testSimpleUnisolatedAllocationContextRecycling() |
void |
testStressAllocationContextRecycling()
This tests whether AllocationContexts efficiently recycle transient
allocations.
|
void |
testStressReplication()
Test low level RWStore add/removeAddress methods as used in HA
WriteCache replication to ensure Allocation consistency
|
void |
testStressUnisolatedAllocationContextRecycling()
This tests whether AllocationContexts efficiently recycle transient
allocations with an Unisolated AllocationContext.
|
void |
testUnisolatedAllocationContextRecycling()
Need to test the handling of aborted Unisolated connections and specifically the
logic behind freed addresses.
|
void |
testVerifyCommitRecordIndex()
Can be tested by removing RWStore call to journal.removeCommitRecordEntries
in freeDeferrals.
|
reopenStore, test_abort, test_closeForWrites, test_restartSafe_multipleWrites, test_restartSafe_oneWrite, test_restartSafe_oneWriteNoCommit
test_overflow, test_writeNoExtend, test_writeWithExtend, writeRandomData
getRandomData, test_close, test_multipleWrites, test_read_correctRejection_0L, test_read_correctRejection_zeroLength, test_readImmutable, test_write_correctRejection_emptyRecord, test_write_correctRejection_null, test_writeImmutable, test_writeRead, test_writeReadRead, testBlobObjectStreams, testEmptyStream, testSimpleStringStream, testSimpleStringStreamFromStandardAllocation, testZipStreams
assertCondition, assertCondition, assertEquals, assertEquals, getBytes, getPort, getRandomData, getRandomData, setUp, tearDown
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
public TestRWJournal.TestRawStore()
public TestRWJournal.TestRawStore(String name)
protected BufferMode getBufferMode()
getBufferMode
in class AbstractBufferStrategyTestCase
public Properties getProperties()
TestCase2
Properties
object, then the lower levels of the
hierarchy are recursively searched.The hierarchy is constructed from the following properties files in the following order. The first property file in this list corresponds to the top of the property hierarchy. The last property file in this list corresponds to the bottom of the property hierarchy. The property resources are:
getProperties
in class AbstractBufferStrategyTestCase
Properties
object that supplies bindings for
property names according to the described hierarchy among
property resources. The returned Properties
is NOT
cached.
TODO This does not handle the recursive truncation of the
class name to search for "test.properties" yet.protected IRawStore getStore()
AbstractRawStoreTestCase
getStore
in class AbstractBufferStrategyTestCase
protected IRawStore getSmallSlotStore()
protected IRawStore getSmallSlotStore(int slotSize)
protected IRawStore getSmallSlotStore(int slotSize, int nWasteAllocators, float maxWaste)
protected Journal getStore(long retentionMillis)
public void test_allocate_then_read()
public void test_reallocate()
public void test_addressing()
public void test_addressingContiguous()
public void test_smallSlotRecycling()
public void test_smallSlotWasteRecylcing()
To mitigate this problem, when more than some minimum number of allocators are in use the storage stats are used to check on overall usage. If the waste is above some specified amount, then an attempt is made to locate a "reasonable" candidate allocator to be used.
To test below sets thresholds to quickly trigger this behaviour, with a low minimum number of allocators, and low "candidate" re-use threshold.
(Small slot optimization to minimize waste).
public void test_allocations()
public void testAllocationReserves()
public void test_reallocation() throws IOException
IOException
public void test_reallocationWithReadAndReopen()
public void notest_stressReallocationWithReadAndReopen()
public void testAllocationContexts()
public void testStressAllocationContextRecycling()
public void testStressUnisolatedAllocationContextRecycling()
public void testUnisolatedAllocationContextRecycling()
The process is to: Allocate a range of data (to establish a number of Allocators) Create an Isolated context and allocate a handful more Create an Unisolated context Free some committed addreses Abort the Unisolated context - calling abort on the Journal Commit the Isolated context Observe if any of the previously committed data is freed!
public void testSimpleUnisolatedAllocationContextRecycling()
public void test_stressReallocationWithRead()
public void notest_stress_alloc_performance()
public void test_blob_allocs()
public void test_blob_readBack()
InterruptedException
public void test_stressBlobReadBack()
public void test_blob_realloc() throws InterruptedException
InterruptedException
public void test_write_flush_update()
public void test_metaAlloc()
public void test_multiVoidCommit()
public void test_allocationContexts() throws IOException
IOException
public void test_stressCommitIndexWithRetention()
public void test_stressCommitIndexNoRetention()
public void test_stressCommit()
public int doStressCommitIndex(long retention, int runs)
public void test_stressAlloc()
public void test_snapshotData() throws IOException
IOException
public void test_sessionProtection()
public void test_stressSessionProtection()
public void testSimpleReplication() throws IOException
IOException
public void testStressReplication() throws IOException
IOException
public void test_pureAlloc()
public void test_allocCommitFree()
public void test_commitState()
RWStore.commit()
is followed by RWStore.reset()
rather than RWStore.postCommit()
.public void test_commitStateError()
RWStore.commit()
will cause problems if the write set is
discarded by RWStore.reset()
such that subsequent write sets
run into persistent addressing errors.public void test_commitStateIllegal()
RWStore.reset()
allwos us to then
apply and commit new write sets.public void test_allocCommitFreeWithHistory()
public void test_blobDeferredFrees()
public void test_stressBlobDeferredFrees()
(recycler error)
public void test_stressBlobBlobHeaderDeferredFrees()
public void test_stressBlobBlobHeaderBlobDataDeferredFrees()
public void testVerifyCommitRecordIndex()
public void testResetHARootBlock()
public void testSimpleReset()
public void test_allocCommitFreeCommit()
public void test_allocCommitFreeCommitWithHistory()
public void test_allocBlobCommitFreeCommitWithHistory()
public void test_allocBlobBoundariesCommitFreeCommitWithHistory()
public void test_allocCommitFreeCommitWriteCache()
public void test_allocCommitFreeCommitWriteCacheWithHistory()
public void test_allocCommitFreeCommitSessionWriteCache()
public void test_allocCommitFreeCommitAllocSessionWriteCache()
public void test_simpleReset()
public void test_reopenReset() throws IOException
IOException
public void test_isolatedReset()
public void test_notSoSimpleIsolatedReset()
public void test_simpleConcurrentReadersWithResets() throws InterruptedException
InterruptedException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.