Skip to content

Commit

Permalink
unit tests: Transaction test UnlockWal fix (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuval-Ariel authored and udi-speedb committed Dec 5, 2023
1 parent 269945d commit 945840a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Speedb Change Log

## Unreleased
Based on RocksDB 8.1.1

Expand All @@ -19,6 +20,7 @@ Based on RocksDB 8.1.1
* Sanitize max_num_parallel_flushes in WBM if 0 (#460)
* WriteController: fix for stop while shutting down (#499)
Also switch to waiting a sec on the CV each time. This is required since a bg error doesn't signal the CV in the WriteController.
* fix UnlockWALStallCleared test in utilities/transactions/transaction_test.cc (#514)

### Miscellaneous
* disable failing unit tests and paired bloom filter stress testing
Expand Down
10 changes: 6 additions & 4 deletions utilities/transactions/transaction_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6764,7 +6764,7 @@ TEST_P(TransactionTest, StallTwoWriteQueues) {
}

// Make sure UnlockWAL does not return until the stall it controls is cleared.
TEST_P(TransactionTest, DISABLED_UnlockWALStallCleared) {
TEST_P(TransactionTest, UnlockWALStallCleared) {
auto dbimpl = static_cast_with_check<DBImpl>(db->GetRootDB());
for (bool external_stall : {false, true}) {
WriteOptions wopts;
Expand Down Expand Up @@ -6826,6 +6826,7 @@ TEST_P(TransactionTest, DISABLED_UnlockWALStallCleared) {
ASSERT_OK(txn0->Put("k3", "val3"));
ASSERT_OK(txn0->Prepare()); // nonmem
ASSERT_OK(txn0->Commit());
t2_completed = true;
}};

// Be sure the test is set up appropriately
Expand All @@ -6834,9 +6835,6 @@ TEST_P(TransactionTest, DISABLED_UnlockWALStallCleared) {
ASSERT_FALSE(t1_completed.load());
ASSERT_FALSE(t2_completed.load());

// Clear the stall
ASSERT_OK(db->UnlockWAL());

WriteOptions wopts2 = wopts;
if (external_stall) {
// We did not deadlock in UnlockWAL, so now async clear the external
Expand All @@ -6854,6 +6852,10 @@ TEST_P(TransactionTest, DISABLED_UnlockWALStallCleared) {
// the thread that did BeginWriteStall() can do EndWriteStall()
wopts2.no_slowdown = true;
}

// Clear the stall
ASSERT_OK(db->UnlockWAL());

std::unique_ptr<Transaction> txn0{db->BeginTransaction(wopts2, {})};
ASSERT_OK(txn0->SetName("x2"));
ASSERT_OK(txn0->Put("k1", "val4"));
Expand Down

0 comments on commit 945840a

Please sign in to comment.