summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2017-07-20 00:19:44 -0400
committerMichael Cahill <michael.cahill@mongodb.com>2017-07-20 14:19:44 +1000
commit00abde90ae32718b5bc4af976114e8ca670cf2a7 (patch)
treee8011bba5cc73d187d4466eea153233f36c3d00d /src/include
parent4ad128a15afc17f77b007295fcdc04e29cb9e292 (diff)
downloadmongo-00abde90ae32718b5bc4af976114e8ca670cf2a7.tar.gz
WT-3418 Fix a block manager race in tree close/open (#3512)
Don't set the handle's WT_DHANDLE_DEAD flag before closing the underlying block manager handle, the block manager asserts there are never two references to the same block store, and it's possible to open another data handle once we mark this handle dead.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/dhandle.h6
-rw-r--r--src/include/extern.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/include/dhandle.h b/src/include/dhandle.h
index 0db59d45691..32574f05fa1 100644
--- a/src/include/dhandle.h
+++ b/src/include/dhandle.h
@@ -99,9 +99,9 @@ struct __wt_data_handle {
/* Flags values over 0xff are reserved for WT_BTREE_* */
#define WT_DHANDLE_DEAD 0x01 /* Dead, awaiting discard */
-#define WT_DHANDLE_DISCARD 0x02 /* Discard on release */
-#define WT_DHANDLE_DISCARD_FORCE 0x04 /* Force discard on release */
-#define WT_DHANDLE_EXCLUSIVE 0x08 /* Need exclusive access */
+#define WT_DHANDLE_DISCARD 0x02 /* Close on release */
+#define WT_DHANDLE_DISCARD_KILL 0x04 /* Mark dead on release */
+#define WT_DHANDLE_EXCLUSIVE 0x08 /* Exclusive access */
#define WT_DHANDLE_IS_METADATA 0x10 /* Metadata handle */
#define WT_DHANDLE_LOCK_ONLY 0x20 /* Handle only used as a lock */
#define WT_DHANDLE_OPEN 0x40 /* Handle is open */
diff --git a/src/include/extern.h b/src/include/extern.h
index 8b48fd587bd..9b47542b494 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -258,11 +258,11 @@ extern int __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_
extern void __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize);
extern int __wt_conn_dhandle_alloc( WT_SESSION_IMPL *session, const char *uri, const char *checkpoint) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_conn_dhandle_find( WT_SESSION_IMPL *session, const char *uri, const char *checkpoint) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
-extern int __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
+extern int __wt_conn_btree_sync_and_close( WT_SESSION_IMPL *session, bool final, bool mark_dead) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_conn_btree_open( WT_SESSION_IMPL *session, const char *cfg[], uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_conn_btree_apply(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
-extern int __wt_conn_dhandle_close_all( WT_SESSION_IMPL *session, const char *uri, bool force) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
-extern int __wt_conn_dhandle_discard_single( WT_SESSION_IMPL *session, bool final, bool force) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
+extern int __wt_conn_dhandle_close_all( WT_SESSION_IMPL *session, const char *uri, bool mark_dead) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
+extern int __wt_conn_dhandle_discard_single( WT_SESSION_IMPL *session, bool final, bool mark_dead) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_conn_dhandle_discard(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_connection_init(WT_CONNECTION_IMPL *conn) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern void __wt_connection_destroy(WT_CONNECTION_IMPL *conn);