From af29e5e78eed5c80427179024543bd88c5f2549d Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Tue, 28 Feb 2017 22:55:30 -0500 Subject: WT-3193 Close a race between verify opening a handle and eviction visiting it (#3316) Leave the WT_BTREE structure mostly untouched until discarding the upper-level data handle, hopefully resolving the problems we've been having with accessing WT_BTREE fields after "closing" the handle. --- src/conn/conn_dhandle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/conn') diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c index 866b8633f71..7b265c372db 100644 --- a/src/conn/conn_dhandle.c +++ b/src/conn/conn_dhandle.c @@ -18,7 +18,7 @@ __conn_dhandle_destroy(WT_SESSION_IMPL *session, WT_DATA_HANDLE *dhandle) __wt_rwlock_destroy(session, &dhandle->rwlock); __wt_free(session, dhandle->name); __wt_free(session, dhandle->checkpoint); - __wt_free(session, dhandle->handle); + __wt_btree_discard(session, &dhandle->handle); __wt_spin_destroy(session, &dhandle->close_lock); __wt_stat_dsrc_discard(session, dhandle); __wt_overwrite_and_free(session, dhandle); @@ -192,6 +192,7 @@ __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force) } WT_TRET(__wt_btree_close(session)); + F_CLR(btree, WT_BTREE_SPECIAL_FLAGS); /* * If we marked a handle dead it will be closed by sweep, via -- cgit v1.2.1