diff options
author | Keith Bostic <keith@wiredtiger.com> | 2016-04-08 17:35:56 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2016-04-08 17:35:56 -0400 |
commit | ad25271a6566132b2a745ca35e6895e464983634 (patch) | |
tree | e86e4ca9a2cc84df509d27f8addda3346bd408da /test/format/ops.c | |
parent | ab42dd2acd99aa288fb3e52d8af3596a0f1ba0d2 (diff) | |
download | mongo-ad25271a6566132b2a745ca35e6895e464983634.tar.gz |
WT-2535: Add an explicit test for lost updates
Don't rollback transactions unless read returns WT_ROLLBACK, not
finding a searched-for key isn't reason to rollback.
Diffstat (limited to 'test/format/ops.c')
-rw-r--r-- | test/format/ops.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/format/ops.c b/test/format/ops.c index 88da95f8a16..54330c6ecd6 100644 --- a/test/format/ops.c +++ b/test/format/ops.c @@ -223,8 +223,9 @@ ops(void *arg) TINFO *tinfo; WT_CONNECTION *conn; WT_CURSOR *cursor, *cursor_insert; - WT_SESSION *session; + WT_DECL_RET; WT_ITEM key, value; + WT_SESSION *session; uint64_t keyno, ckpt_op, reset_op, session_op; uint32_t op; uint8_t *keybuf, *valbuf; @@ -480,9 +481,9 @@ skip_insert: if (col_update(tinfo, } } else { ++tinfo->search; - if (read_row(cursor, &key, keyno, 0)) - if (intxn) - goto deadlock; + ret = read_row(cursor, &key, keyno, 0); + if (intxn && ret == WT_ROLLBACK) + goto deadlock; continue; } @@ -503,7 +504,8 @@ skip_insert: if (col_update(tinfo, /* Read to confirm the operation. */ ++tinfo->search; - if (read_row(cursor, &key, keyno, 0)) + ret = read_row(cursor, &key, keyno, 0); + if (intxn && ret == WT_ROLLBACK) goto deadlock; /* Reset the cursor: there is no reason to keep pages pinned. */ |