Skip to content

Commit 6f9b82e

Browse files
ruby-oujoEvergreen Agent
authored andcommitted
Import wiredtiger: c1dde2389d34cf4bc0ccfbc5e6e1136f3dbc8ae9 from branch mongodb-master
ref: 15e567db3a..c1dde2389d for: 7.2.0-rc0 WT-11772 Only rollback txn when the target has been reached in the cppsuite
1 parent 915b78f commit 6f9b82e

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

src/third_party/wiredtiger/import.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"vendor": "wiredtiger",
33
"github": "wiredtiger/wiredtiger.git",
44
"branch": "mongodb-master",
5-
"commit": "15e567db3a1adbc9b520a479a9d99bd448a1bd9c"
5+
"commit": "c1dde2389d34cf4bc0ccfbc5e6e1136f3dbc8ae9"
66
}

src/third_party/wiredtiger/test/cppsuite/src/main/database_operation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ database_operation::read_operation(thread_worker *tc)
267267
testutil_die(ret, "Unexpected error returned from cursor->next()");
268268
}
269269
tc->txn.add_op();
270-
tc->txn.try_rollback();
270+
if (tc->txn.get_op_count() >= tc->txn.get_target_op_count())
271+
tc->txn.rollback();
271272
tc->sleep();
272273
}
273274
/* Reset our cursor to avoid pinning content. */

src/third_party/wiredtiger/test/cppsuite/src/main/transaction.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ transaction::try_rollback(const std::string &config)
126126
rollback(config);
127127
}
128128

129+
int64_t
130+
transaction::get_op_count() const
131+
{
132+
return _op_count;
133+
}
134+
129135
int64_t
130136
transaction::get_target_op_count() const
131137
{

src/third_party/wiredtiger/test/cppsuite/src/main/transaction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class transaction {
6666
* the transaction.
6767
*/
6868
bool can_commit();
69+
/* Get the current number of operations executed. */
70+
int64_t get_op_count() const;
6971
/* Get the number of operations this transaction needs before it can commit */
7072
int64_t get_target_op_count() const;
7173

src/third_party/wiredtiger/test/cppsuite/tests/bounded_cursor_prefix_search_near.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ class bounded_cursor_prefix_search_near : public test {
211211
ret, exact_prefix, key_prefix_str, cursor_default, generated_prefix);
212212

213213
tc->txn.add_op();
214-
tc->txn.try_rollback();
214+
if (tc->txn.get_op_count() >= tc->txn.get_target_op_count())
215+
tc->txn.rollback();
215216
tc->sleep();
216217
}
217218
testutil_check(cursor_prefix->reset(cursor_prefix.get()));

src/third_party/wiredtiger/test/cppsuite/tests/bounded_cursor_stress.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,8 @@ class bounded_cursor_stress : public test {
763763
testutil_assert(ret == 0 || ret == WT_ROLLBACK);
764764
}
765765
tc->txn.add_op();
766-
tc->txn.try_rollback();
766+
if (tc->txn.get_op_count() >= tc->txn.get_target_op_count())
767+
tc->txn.rollback();
767768
tc->sleep();
768769
}
769770
normal_cursor->reset(normal_cursor.get());

0 commit comments

Comments
 (0)