|
|
@ -98,6 +98,7 @@ TEST_P(TransactionTest, DoubleEmptyWrite) { |
|
|
|
delete txn0; |
|
|
|
delete txn0; |
|
|
|
reinterpret_cast<PessimisticTransactionDB*>(db)->TEST_Crash(); |
|
|
|
reinterpret_cast<PessimisticTransactionDB*>(db)->TEST_Crash(); |
|
|
|
ASSERT_OK(ReOpenNoDelete()); |
|
|
|
ASSERT_OK(ReOpenNoDelete()); |
|
|
|
|
|
|
|
assert(db != nullptr); |
|
|
|
txn0 = db->GetTransactionByName("xid2"); |
|
|
|
txn0 = db->GetTransactionByName("xid2"); |
|
|
|
ASSERT_OK(txn0->Commit()); |
|
|
|
ASSERT_OK(txn0->Commit()); |
|
|
|
delete txn0; |
|
|
|
delete txn0; |
|
|
@ -145,6 +146,7 @@ TEST_P(TransactionTest, ValidateSnapshotTest) { |
|
|
|
ReadOptions read_options; |
|
|
|
ReadOptions read_options; |
|
|
|
std::string value; |
|
|
|
std::string value; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert(db != nullptr); |
|
|
|
Transaction* txn1 = |
|
|
|
Transaction* txn1 = |
|
|
|
db->BeginTransaction(write_options, TransactionOptions()); |
|
|
|
db->BeginTransaction(write_options, TransactionOptions()); |
|
|
|
ASSERT_TRUE(txn1); |
|
|
|
ASSERT_TRUE(txn1); |
|
|
@ -935,6 +937,7 @@ TEST_P(TransactionTest, SimpleTwoPhaseTransactionTest) { |
|
|
|
// kill and reopen to trigger recovery
|
|
|
|
// kill and reopen to trigger recovery
|
|
|
|
s = ReOpenNoDelete(); |
|
|
|
s = ReOpenNoDelete(); |
|
|
|
ASSERT_OK(s); |
|
|
|
ASSERT_OK(s); |
|
|
|
|
|
|
|
assert(db != nullptr); |
|
|
|
s = db->Get(read_options, "gtid", &value); |
|
|
|
s = db->Get(read_options, "gtid", &value); |
|
|
|
ASSERT_OK(s); |
|
|
|
ASSERT_OK(s); |
|
|
|
ASSERT_EQ(value, "dogs"); |
|
|
|
ASSERT_EQ(value, "dogs"); |
|
|
@ -1065,6 +1068,7 @@ TEST_P(TransactionTest, TwoPhaseEmptyWriteTest) { |
|
|
|
// kill and reopen to trigger recovery
|
|
|
|
// kill and reopen to trigger recovery
|
|
|
|
s = ReOpenNoDelete(); |
|
|
|
s = ReOpenNoDelete(); |
|
|
|
ASSERT_OK(s); |
|
|
|
ASSERT_OK(s); |
|
|
|
|
|
|
|
assert(db != nullptr); |
|
|
|
s = db->Get(read_options, "foo", &value); |
|
|
|
s = db->Get(read_options, "foo", &value); |
|
|
|
ASSERT_OK(s); |
|
|
|
ASSERT_OK(s); |
|
|
|
ASSERT_EQ(value, "bar"); |
|
|
|
ASSERT_EQ(value, "bar"); |
|
|
@ -1419,6 +1423,7 @@ TEST_P(TransactionTest, TwoPhaseLongPrepareTest) { |
|
|
|
for (int i = 0; i < 1000; i++) { |
|
|
|
for (int i = 0; i < 1000; i++) { |
|
|
|
std::string key(i, 'k'); |
|
|
|
std::string key(i, 'k'); |
|
|
|
std::string val(1000, 'v'); |
|
|
|
std::string val(1000, 'v'); |
|
|
|
|
|
|
|
assert(db != nullptr); |
|
|
|
s = db->Put(write_options, key, val); |
|
|
|
s = db->Put(write_options, key, val); |
|
|
|
ASSERT_OK(s); |
|
|
|
ASSERT_OK(s); |
|
|
|
|
|
|
|
|
|
|
@ -1494,6 +1499,7 @@ TEST_P(TransactionTest, TwoPhaseSequenceTest) { |
|
|
|
// kill and reopen
|
|
|
|
// kill and reopen
|
|
|
|
env->SetFilesystemActive(false); |
|
|
|
env->SetFilesystemActive(false); |
|
|
|
ReOpenNoDelete(); |
|
|
|
ReOpenNoDelete(); |
|
|
|
|
|
|
|
assert(db != nullptr); |
|
|
|
|
|
|
|
|
|
|
|
// value is now available
|
|
|
|
// value is now available
|
|
|
|
s = db->Get(read_options, "foo4", &value); |
|
|
|
s = db->Get(read_options, "foo4", &value); |
|
|
@ -1560,6 +1566,7 @@ TEST_P(TransactionTest, TwoPhaseDoubleRecoveryTest) { |
|
|
|
// kill and reopen
|
|
|
|
// kill and reopen
|
|
|
|
env->SetFilesystemActive(false); |
|
|
|
env->SetFilesystemActive(false); |
|
|
|
ReOpenNoDelete(); |
|
|
|
ReOpenNoDelete(); |
|
|
|
|
|
|
|
assert(db != nullptr); |
|
|
|
|
|
|
|
|
|
|
|
// value is now available
|
|
|
|
// value is now available
|
|
|
|
s = db->Get(read_options, "foo", &value); |
|
|
|
s = db->Get(read_options, "foo", &value); |
|
|
@ -1912,6 +1919,7 @@ TEST_P(TransactionTest, TwoPhaseOutOfOrderDelete) { |
|
|
|
env->SetFilesystemActive(false); |
|
|
|
env->SetFilesystemActive(false); |
|
|
|
reinterpret_cast<PessimisticTransactionDB*>(db)->TEST_Crash(); |
|
|
|
reinterpret_cast<PessimisticTransactionDB*>(db)->TEST_Crash(); |
|
|
|
ReOpenNoDelete(); |
|
|
|
ReOpenNoDelete(); |
|
|
|
|
|
|
|
assert(db != nullptr); |
|
|
|
|
|
|
|
|
|
|
|
s = db->Get(read_options, "first", &value); |
|
|
|
s = db->Get(read_options, "first", &value); |
|
|
|
ASSERT_OK(s); |
|
|
|
ASSERT_OK(s); |
|
|
@ -2180,6 +2188,7 @@ TEST_P(TransactionTest, FlushTest2) { |
|
|
|
|
|
|
|
|
|
|
|
Status s = ReOpen(); |
|
|
|
Status s = ReOpen(); |
|
|
|
ASSERT_OK(s); |
|
|
|
ASSERT_OK(s); |
|
|
|
|
|
|
|
assert(db != nullptr); |
|
|
|
|
|
|
|
|
|
|
|
WriteOptions write_options; |
|
|
|
WriteOptions write_options; |
|
|
|
ReadOptions read_options, snapshot_read_options; |
|
|
|
ReadOptions read_options, snapshot_read_options; |
|
|
|