summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2015-05-18 12:24:32 +1000
committerMichael Cahill <michael.cahill@mongodb.com>2015-05-25 16:43:19 +1000
commitc81beade99f4b32665c3c6a322025abdb98042af (patch)
treedda374a7d58ba5a94f6951610e53ffae3ddf4b98
parenta1ec3b331a83b84b716ed3477d1f1fe3e4d6fdfd (diff)
downloadmongo-c81beade99f4b32665c3c6a322025abdb98042af.tar.gz
Merge pull request #1976 from wiredtiger/checkpoint-dead
Don't checkpoint dead handles (cherry picked from commit 7fd00eda083e174b5681252b1cd6abffe10f0a1d)
-rw-r--r--src/conn/conn_dhandle.c4
-rw-r--r--test/fops/file.c14
-rw-r--r--test/fops/fops.c6
-rw-r--r--test/fops/thread.h6
4 files changed, 17 insertions, 13 deletions
diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c
index 65b9af1aa01..991b1bc6fe8 100644
--- a/src/conn/conn_dhandle.c
+++ b/src/conn/conn_dhandle.c
@@ -656,6 +656,7 @@ __wt_conn_btree_apply_single(WT_SESSION_IMPL *session,
bucket = hash % WT_HASH_ARRAY_SIZE;
SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl)
if (F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
+ !F_ISSET(dhandle, WT_DHANDLE_DEAD) &&
(hash == dhandle->name_hash &&
strcmp(uri, dhandle->name) == 0) &&
((dhandle->checkpoint == NULL && checkpoint == NULL) ||
@@ -670,7 +671,8 @@ __wt_conn_btree_apply_single(WT_SESSION_IMPL *session,
* still open.
*/
__wt_spin_lock(session, &dhandle->close_lock);
- if (F_ISSET(dhandle, WT_DHANDLE_OPEN)) {
+ if (F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
+ !F_ISSET(dhandle, WT_DHANDLE_DEAD)) {
WT_WITH_DHANDLE(session, dhandle,
ret = func(session, cfg));
}
diff --git a/test/fops/file.c b/test/fops/file.c
index 2763afc5bca..be9eca0e2b1 100644
--- a/test/fops/file.c
+++ b/test/fops/file.c
@@ -58,7 +58,7 @@ obj_bulk(void)
}
void
-obj_bulk_unique(void)
+obj_bulk_unique(int force)
{
WT_CURSOR *c;
WT_SESSION *session;
@@ -86,7 +86,8 @@ obj_bulk_unique(void)
if ((ret = c->close(c)) != 0)
die(ret, "cursor.close");
- while ((ret = session->drop(session, new_uri, NULL)) != 0)
+ while ((ret = session->drop(
+ session, new_uri, force ? "force" : NULL)) != 0)
if (ret != EBUSY)
die(ret, "session.drop: %s", new_uri);
@@ -134,7 +135,7 @@ obj_create(void)
}
void
-obj_create_unique(void)
+obj_create_unique(int force)
{
WT_SESSION *session;
int ret;
@@ -154,7 +155,8 @@ obj_create_unique(void)
die(ret, "session.create");
sched_yield();
- while ((ret = session->drop(session, new_uri, NULL)) != 0)
+ while ((ret = session->drop(
+ session, new_uri, force ? "force" : NULL)) != 0)
if (ret != EBUSY)
die(ret, "session.drop: %s", new_uri);
@@ -163,7 +165,7 @@ obj_create_unique(void)
}
void
-obj_drop(void)
+obj_drop(int force)
{
WT_SESSION *session;
int ret;
@@ -171,7 +173,7 @@ obj_drop(void)
if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
die(ret, "conn.session");
- if ((ret = session->drop(session, uri, NULL)) != 0)
+ if ((ret = session->drop(session, uri, force ? "force" : NULL)) != 0)
if (ret != ENOENT && ret != EBUSY)
die(ret, "session.drop");
diff --git a/test/fops/fops.c b/test/fops/fops.c
index 13bd75d7407..21c37268f8e 100644
--- a/test/fops/fops.c
+++ b/test/fops/fops.c
@@ -144,7 +144,7 @@ fop(void *arg)
break;
case 3:
++s->drop;
- obj_drop();
+ obj_drop(__wt_random(rnd) & 1);
break;
case 4:
++s->ckpt;
@@ -160,11 +160,11 @@ fop(void *arg)
break;
case 7:
++s->bulk_unique;
- obj_bulk_unique();
+ obj_bulk_unique(__wt_random(rnd) & 1);
break;
case 8:
++s->create_unique;
- obj_create_unique();
+ obj_create_unique(__wt_random(rnd) & 1);
break;
}
diff --git a/test/fops/thread.h b/test/fops/thread.h
index 72333f5f710..ec62c28a295 100644
--- a/test/fops/thread.h
+++ b/test/fops/thread.h
@@ -61,12 +61,12 @@ extern pthread_rwlock_t single; /* Single-thread */
int fop_start(u_int);
void obj_bulk(void);
-void obj_bulk_unique(void);
+void obj_bulk_unique(int);
void obj_checkpoint(void);
void obj_create(void);
-void obj_create_unique(void);
+void obj_create_unique(int);
void obj_cursor(void);
-void obj_drop(void);
+void obj_drop(int);
void obj_upgrade(void);
void obj_verify(void);