public void when_an_epoch_checksum_is_ahead_of_writer_checksum_throws_corrupt_database_exception() { var config = TFChunkHelper.CreateDbConfigEx(PathName, 0, 0, 11, -1, -1, 1000, -1); using (var db = new TFChunkDb(config)) { Assert.That(() => db.Open(verifyHash: false), Throws.Exception.InstanceOf <CorruptDatabaseException>() .With.InnerException.InstanceOf <ReaderCheckpointHigherThanWriterException>()); } }
public override async Task TestFixtureSetUp() { await base.TestFixtureSetUp(); // writer checkpoint = 5500, truncate to 0, max truncation = 1000 _config = TFChunkHelper.CreateDbConfigEx(PathName, 5500, 5500, 5500, -1, 0, 1000, maxTruncation: 1000); DbUtil.CreateMultiChunk(_config, 0, 2, GetFilePathFor("chunk-000000.000001")); DbUtil.CreateMultiChunk(_config, 0, 2, GetFilePathFor("chunk-000000.000002")); DbUtil.CreateMultiChunk(_config, 3, 10, GetFilePathFor("chunk-000003.000001")); DbUtil.CreateMultiChunk(_config, 3, 10, GetFilePathFor("chunk-000003.000002")); DbUtil.CreateMultiChunk(_config, 7, 8, GetFilePathFor("chunk-000007.000001")); DbUtil.CreateOngoingChunk(_config, 11, GetFilePathFor("chunk-000011.000000")); }
public override async Task TestFixtureSetUp() { await base.TestFixtureSetUp(); _config = TFChunkHelper.CreateDbConfigEx(PathName, 11111, 5500, 5500, -1, 5757, 1000, -1); DbUtil.CreateMultiChunk(_config, 0, 2, GetFilePathFor("chunk-000000.000001")); DbUtil.CreateMultiChunk(_config, 0, 2, GetFilePathFor("chunk-000000.000002")); DbUtil.CreateMultiChunk(_config, 3, 10, GetFilePathFor("chunk-000003.000001")); DbUtil.CreateMultiChunk(_config, 3, 10, GetFilePathFor("chunk-000003.000002")); DbUtil.CreateMultiChunk(_config, 7, 8, GetFilePathFor("chunk-000007.000001")); DbUtil.CreateOngoingChunk(_config, 11, GetFilePathFor("chunk-000011.000000")); var truncator = new TFChunkDbTruncator(_config); truncator.TruncateDb(_config.TruncateCheckpoint.ReadNonFlushed()); }
public override async Task TestFixtureSetUp() { await base.TestFixtureSetUp(); _config = TFChunkHelper.CreateDbConfigEx(PathName, 1711, 5500, 5500, -1, 1111, 1000, -1); var rnd = new Random(); _file1Contents = new byte[_config.ChunkSize]; _file2Contents = new byte[_config.ChunkSize]; rnd.NextBytes(_file1Contents); rnd.NextBytes(_file2Contents); DbUtil.CreateSingleChunk(_config, 0, GetFilePathFor("chunk-000000.000001"), contents: _file1Contents); DbUtil.CreateOngoingChunk(_config, 1, GetFilePathFor("chunk-000001.000002"), contents: _file2Contents); var truncator = new TFChunkDbTruncator(_config); truncator.TruncateDb(_config.TruncateCheckpoint.ReadNonFlushed()); }