diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-02-17 17:25:57 +0000 |
|---|---|---|
| committer | <> | 2015-03-17 16:26:24 +0000 |
| commit | 780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch) | |
| tree | 598f8b9fa431b228d29897e798de4ac0c1d3d970 /src/dbinc/region.h | |
| parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
| download | berkeleydb-master.tar.gz | |
Diffstat (limited to 'src/dbinc/region.h')
| -rw-r--r-- | src/dbinc/region.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/dbinc/region.h b/src/dbinc/region.h index ac0ff16f..070aff5f 100644 --- a/src/dbinc/region.h +++ b/src/dbinc/region.h @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved. * * $Id$ */ @@ -134,7 +134,10 @@ typedef enum { REGION_TYPE_LOG, REGION_TYPE_MPOOL, REGION_TYPE_MUTEX, - REGION_TYPE_TXN } reg_type_t; + REGION_TYPE_TXN, + /* This enum always must be the last, and is the largest valid type. */ + REGION_TYPE_MAX = REGION_TYPE_TXN +} reg_type_t; #define INVALID_REGION_SEGID -1 /* Segment IDs are either shmget(2) or * Win16 segment identifiers. They are @@ -196,10 +199,10 @@ typedef struct __db_reg_env { /* SHARED */ /* - * The mtx_regenv mutex protects the environment reference count and - * memory allocation from the primary shared region (the crypto, thread - * control block and replication implementations allocate memory from - * the primary shared region). + * The mtx_regenv mutex protects the environment reference count, + * blob threshold and memory allocation from the primary shared region + * (the crypto, thread control block and replication implementations + * allocate memory from the primary shared region). * * The rest of the fields are initialized at creation time, and don't * need mutex protection. The flags, op_timestamp and rep_timestamp @@ -209,6 +212,7 @@ typedef struct __db_reg_env { /* SHARED */ */ db_mutex_t mtx_regenv; /* Refcnt, region allocation mutex. */ u_int32_t refcnt; /* References to the environment. */ + u_int32_t blob_threshold; /* Environment wide blob threshold. */ u_int32_t region_cnt; /* Number of REGIONs. */ roff_t region_off; /* Offset of region array */ @@ -227,6 +231,8 @@ typedef struct __db_reg_env { /* SHARED */ time_t op_timestamp; /* Timestamp for operations. */ time_t rep_timestamp; /* Timestamp for rep db handles. */ u_int32_t reg_panic; /* DB_REGISTER triggered panic */ + u_int32_t failure_panic; /* Failchk or mutex lock saw a crash. */ + char failure_symptom[DB_FAILURE_SYMPTOM_SIZE]; uintmax_t unused; /* The ALLOC_LAYOUT structure follows * the REGENV structure in memory and * contains uintmax_t fields. Force @@ -308,11 +314,14 @@ struct __db_reginfo_t { /* __env_region_attach IN parameters. */ /* * PANIC_ISSET, PANIC_CHECK: - * Check to see if the DB environment is dead. + * Check to see if the DB environment is dead. If the environment is still + * attached to its regions, look in the REGENV. Otherwise, check whether + * the region had the panic state set when this even detached from it. */ #define PANIC_ISSET(env) \ - ((env) != NULL && (env)->reginfo != NULL && \ - ((REGENV *)(env)->reginfo->primary)->panic != 0 && \ + ((env) != NULL && ((env)->reginfo != NULL ? \ + ((REGENV *)(env)->reginfo->primary)->panic != 0 : \ + F_ISSET(env, ENV_REMEMBER_PANIC)) && \ !F_ISSET((env)->dbenv, DB_ENV_NOPANIC)) #define PANIC_CHECK(env) \ |
