From f045ee6422cc8cfa1bfa72a2f24846b35d539e32 Mon Sep 17 00:00:00 2001 From: Cheng Chang Date: Tue, 30 Jun 2020 14:26:37 -0700 Subject: [PATCH] Increase transaction timeout and enable deadlock detection in stress test (#7056) Summary: There are errors like `Transaction put: Operation timed out: Timeout waiting to lock key terminate called without an active exception`, based on experiment on devserver, increasing timeouts can resolve the issue. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7056 Test Plan: watch stress test with txn. Reviewed By: anand1976 Differential Revision: D22317265 Pulled By: cheng-chang fbshipit-source-id: 2dc3352def5e78d2c39a18d7262a3a65ca98bbba --- db_stress_tool/db_stress_test_base.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index d2232ccfb..bdb965d93 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -463,6 +463,8 @@ Status StressTest::NewTxn(WriteOptions& write_opts, Transaction** txn) { } static std::atomic txn_id = {0}; TransactionOptions txn_options; + txn_options.lock_timeout = 60000; // 1min + txn_options.deadlock_detect = true; *txn = txn_db_->BeginTransaction(write_opts, txn_options); auto istr = std::to_string(txn_id.fetch_add(1)); Status s = (*txn)->SetName("xid" + istr);