diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2017-03-24 07:52:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 07:52:59 -0400 |
commit | 56fa32f25a0745b049789f31e7dd5128be9525a0 (patch) | |
tree | 6ea543810f32defdd5ffb82521a9ac2162d8ef97 | |
parent | 54909d4c49019e6d9d007d3783cb8f3dbbccba84 (diff) | |
download | mongo-56fa32f25a0745b049789f31e7dd5128be9525a0.tar.gz |
WT-98 Update the current cursor value without a search (#3346)
* WT-98 Update the current cursor value without a search
When running in-memory and insert/update fails, we should expect
WT_ROLLBACK even when not running inside a transaction.
* Order the operations alphabetically (they were ordered the way they were
because of the order in which we used to choose operations, but that's no
longer the case).
-rw-r--r-- | test/format/ops.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/test/format/ops.c b/test/format/ops.c index 05457ebb5a0..5309edf81c0 100644 --- a/test/format/ops.c +++ b/test/format/ops.c @@ -660,33 +660,6 @@ skip_checkpoint: /* Pick the next checkpoint operation. */ #endif /* Perform the operation. */ switch (op) { - case REMOVE: - switch (g.type) { - case ROW: - ret = - row_remove(cursor, key, keyno, positioned); - break; - case FIX: - case VAR: - ret = - col_remove(cursor, key, keyno, positioned); - break; - } - if (ret == 0) { - ++tinfo->remove; - /* - * Don't set positioned: it's unchanged from the - * previous state, but not necessarily set. - */ - if (SNAP_TRACK) - snap_track(snap++, keyno, NULL, NULL); - } else { - positioned = false; - if (ret == WT_ROLLBACK && intxn) - goto deadlock; - testutil_assert(ret == WT_NOTFOUND); - } - break; case INSERT: switch (g.type) { case ROW: @@ -718,7 +691,48 @@ skip_checkpoint: /* Pick the next checkpoint operation. */ } else { if (ret == WT_ROLLBACK && intxn) goto deadlock; - testutil_assert(ret == 0); + testutil_assert(ret == 0 || ret == WT_ROLLBACK); + } + break; + case READ: + ++tinfo->search; + ret = read_row(cursor, key, value, keyno); + if (ret == 0) { + positioned = true; + if (SNAP_TRACK) + snap_track(snap++, keyno, NULL, value); + } else { + positioned = false; + if (ret == WT_ROLLBACK && intxn) + goto deadlock; + testutil_assert(ret == WT_NOTFOUND); + } + break; + case REMOVE: + switch (g.type) { + case ROW: + ret = + row_remove(cursor, key, keyno, positioned); + break; + case FIX: + case VAR: + ret = + col_remove(cursor, key, keyno, positioned); + break; + } + if (ret == 0) { + ++tinfo->remove; + /* + * Don't set positioned: it's unchanged from the + * previous state, but not necessarily set. + */ + if (SNAP_TRACK) + snap_track(snap++, keyno, NULL, NULL); + } else { + positioned = false; + if (ret == WT_ROLLBACK && intxn) + goto deadlock; + testutil_assert(ret == WT_NOTFOUND); } break; case UPDATE: @@ -745,21 +759,7 @@ update_instead_of_insert: positioned = false; if (ret == WT_ROLLBACK && intxn) goto deadlock; - testutil_assert(ret == 0); - } - break; - case READ: - ++tinfo->search; - ret = read_row(cursor, key, value, keyno); - if (ret == 0) { - positioned = true; - if (SNAP_TRACK) - snap_track(snap++, keyno, NULL, value); - } else { - positioned = false; - if (ret == WT_ROLLBACK && intxn) - goto deadlock; - testutil_assert(ret == WT_NOTFOUND); + testutil_assert(ret == 0 || ret == WT_ROLLBACK); } break; } |