Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction test unlock wal fix #514

Merged
merged 3 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -6641,7 +6641,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 @@ -6703,6 +6703,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 @@ -6711,9 +6712,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 @@ -6731,6 +6729,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