summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/fops
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2017-04-01 07:14:43 +1100
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-04-01 07:25:11 +1100
commitf6cbdfb8c5c52209f58562ccbe14013c72df3f40 (patch)
tree850ab25ff8e499689bd40ccdad284e629fafec7e /src/third_party/wiredtiger/test/fops
parent08d29c36403608802c45375277f88c7fcaf708e0 (diff)
downloadmongo-f6cbdfb8c5c52209f58562ccbe14013c72df3f40.tar.gz
Import wiredtiger: af735d14a603a6ef6256a6685f09ec13755a5024 from branch mongodb-3.6
ref: cc2f15f595..af735d14a6 for: 3.5.6 SERVER-28168 Cannot start or repair mongodb after unexpected shutdown. SERVER-28194 Missing WiredTiger.turtle file loses data WT-2439 Enhance reconciliation page layout WT-2978 Make WiredTiger python binding pip-compatible WT-2990 Fix a new bug where checkpoint load live_open failed WT-3136 bug fix: WiredTiger doesn't check sprintf calls for error return WT-3155 Remove WT_CONN_SERVER_RUN flag WT-3182 Switch make-check to run the short test suite by default WT-3190 Enhance eviction thread auto-tuning algorithm WT-3191 Fix lint complaints WT-3193 Close a race between verify opening a handle and eviction visiting it WT-3196 Race with LSM and eviction when switching chunks WT-3199 bug: eviction assertion failure WT-3202 wtperf report an error on in_memory=true mode : No such file or directory WT-3203 bulk-load state changes can race WT-3204 eviction changes cost LSM performance WT-3206 bug: core dump on NULL page index WT-3207 Drops with checkpoint_wait=false should not wait for checkpoints WT-3208 test format hung with 9mb cache WT-3211 WT_CURSOR.remove cannot always retain its position. WT-3212 'wt dump' crashes when given table with unknown collator WT-3213 generated test/format CONFIG invalid on next run WT-3216 add support for clang-tidy WT-3218 unexpected checkpoint ordering failures WT-3224 LSM assertion failure pindex->entries == 1 WT-3225 WiredTiger won't build with clang on CentOS 7.3.1611 WT-3227 Python test suite inserts unnecessary whitespace in error output. WT-3228 Remove with overwrite shouldn't return WT_NOTFOUND WT-3234 Update WiredTiger build for clang 4.0. WT-3238 Java: Cursor.compare and Cursor.equals throw Exceptions for valid return values WT-3240 Coverity reports WT-3243 Reorder log slot release so joins don't wait on IO WT-3244 Metadata operations failing in in-memory configurations when the cache is full WT-98 Update the current cursor value without a search
Diffstat (limited to 'src/third_party/wiredtiger/test/fops')
-rw-r--r--src/third_party/wiredtiger/test/fops/file.c33
-rw-r--r--src/third_party/wiredtiger/test/fops/t.c21
2 files changed, 31 insertions, 23 deletions
diff --git a/src/third_party/wiredtiger/test/fops/file.c b/src/third_party/wiredtiger/test/fops/file.c
index ea15f1ee80d..d1cd22ab391 100644
--- a/src/third_party/wiredtiger/test/fops/file.c
+++ b/src/third_party/wiredtiger/test/fops/file.c
@@ -51,7 +51,7 @@ obj_bulk(void)
if ((ret = c->close(c)) != 0)
testutil_die(ret, "cursor.close");
} else if (ret != ENOENT && ret != EBUSY && ret != EINVAL)
- testutil_die(ret, "session.open_cursor");
+ testutil_die(ret, "session.open_cursor bulk");
}
if ((ret = session->close(session, NULL)) != 0)
testutil_die(ret, "session.close");
@@ -71,7 +71,8 @@ obj_bulk_unique(int force)
/* Generate a unique object name. */
if ((ret = pthread_rwlock_wrlock(&single)) != 0)
testutil_die(ret, "pthread_rwlock_wrlock single");
- (void)snprintf(new_uri, sizeof(new_uri), "%s.%u", uri, ++uid);
+ testutil_check(__wt_snprintf(
+ new_uri, sizeof(new_uri), "%s.%u", uri, ++uid));
if ((ret = pthread_rwlock_unlock(&single)) != 0)
testutil_die(ret, "pthread_rwlock_unlock single");
@@ -79,12 +80,17 @@ obj_bulk_unique(int force)
testutil_die(ret, "session.create: %s", new_uri);
__wt_yield();
- if ((ret =
- session->open_cursor(session, new_uri, NULL, "bulk", &c)) != 0)
- testutil_die(ret, "session.open_cursor: %s", new_uri);
-
- if ((ret = c->close(c)) != 0)
- testutil_die(ret, "cursor.close");
+ /*
+ * Opening a bulk cursor may have raced with a forced checkpoint
+ * which created a checkpoint of the empty file, and triggers an EINVAL
+ */
+ if ((ret = session->open_cursor(
+ session, new_uri, NULL, "bulk", &c)) == 0) {
+ if ((ret = c->close(c)) != 0)
+ testutil_die(ret, "cursor.close");
+ } else if (ret != EINVAL)
+ testutil_die(ret,
+ "session.open_cursor bulk unique: %s, new_uri");
while ((ret = session->drop(
session, new_uri, force ? "force" : NULL)) != 0)
@@ -147,7 +153,8 @@ obj_create_unique(int force)
/* Generate a unique object name. */
if ((ret = pthread_rwlock_wrlock(&single)) != 0)
testutil_die(ret, "pthread_rwlock_wrlock single");
- (void)snprintf(new_uri, sizeof(new_uri), "%s.%u", uri, ++uid);
+ testutil_check(__wt_snprintf(
+ new_uri, sizeof(new_uri), "%s.%u", uri, ++uid));
if ((ret = pthread_rwlock_unlock(&single)) != 0)
testutil_die(ret, "pthread_rwlock_unlock single");
@@ -190,9 +197,13 @@ obj_checkpoint(void)
if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
testutil_die(ret, "conn.session");
- /* Force the checkpoint so it has to be taken. */
+ /*
+ * Force the checkpoint so it has to be taken. Forced checkpoints can
+ * race with other metadata operations and return EBUSY - we'd expect
+ * applications using forced checkpoints to retry on EBUSY.
+ */
if ((ret = session->checkpoint(session, "force")) != 0)
- if (ret != ENOENT)
+ if (ret != EBUSY && ret != ENOENT)
testutil_die(ret, "session.checkpoint");
if ((ret = session->close(session, NULL)) != 0)
diff --git a/src/third_party/wiredtiger/test/fops/t.c b/src/third_party/wiredtiger/test/fops/t.c
index 7b4a7cf8fca..07ac07349e3 100644
--- a/src/third_party/wiredtiger/test/fops/t.c
+++ b/src/third_party/wiredtiger/test/fops/t.c
@@ -34,7 +34,6 @@ u_int nops; /* Operations */
const char *uri; /* Object */
const char *config; /* Object config */
-static char *progname; /* Program name */
static FILE *logfp; /* Log file */
static char home[512];
@@ -71,22 +70,15 @@ main(int argc, char *argv[])
int ch, cnt, ret, runs;
char *config_open, *working_dir;
- working_dir = NULL;
-
- /* Remove directories */
- if ((progname = strrchr(argv[0], DIR_DELIM)) == NULL)
- progname = argv[0];
- else
- ++progname;
+ (void)testutil_set_progname(argv);
if ((ret = pthread_rwlock_init(&single, NULL)) != 0)
testutil_die(ret, "pthread_rwlock_init: single");
- config_open = NULL;
nops = 1000;
nthreads = 10;
runs = 1;
-
+ config_open = working_dir = NULL;
while ((ch = __wt_getopt(progname, argc, argv, "C:h:l:n:r:t:")) != EOF)
switch (ch) {
case 'C': /* wiredtiger_open config */
@@ -165,11 +157,11 @@ wt_startup(char *config_open)
testutil_make_work_dir(home);
- snprintf(config_buf, sizeof(config_buf),
+ testutil_check(__wt_snprintf(config_buf, sizeof(config_buf),
"create,error_prefix=\"%s\",cache_size=5MB%s%s",
progname,
config_open == NULL ? "" : ",",
- config_open == NULL ? "" : config_open);
+ config_open == NULL ? "" : config_open));
if ((ret = wiredtiger_open(
home, &event_handler, config_buf, &conn)) != 0)
testutil_die(ret, "wiredtiger_open");
@@ -225,6 +217,11 @@ handle_message(WT_EVENT_HANDLER *handler,
(void)(handler);
(void)(session);
+ /* Ignore messages about failing to create forced checkpoints. */
+ if (strstr(
+ message, "forced or named checkpoint") != NULL)
+ return (0);
+
if (logfp != NULL)
return (fprintf(logfp, "%s\n", message) < 0 ? -1 : 0);