summaryrefslogtreecommitdiff
path: root/src/dbinc/db_am.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-02-17 17:25:57 +0000
committer <>2015-03-17 16:26:24 +0000
commit780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch)
tree598f8b9fa431b228d29897e798de4ac0c1d3d970 /src/dbinc/db_am.h
parent7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff)
downloadberkeleydb-master.tar.gz
Imported from /home/lorry/working-area/delta_berkeleydb/db-6.1.23.tar.gz.HEADdb-6.1.23master
Diffstat (limited to 'src/dbinc/db_am.h')
-rw-r--r--src/dbinc/db_am.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dbinc/db_am.h b/src/dbinc/db_am.h
index f34578c4..2b5c49d2 100644
--- a/src/dbinc/db_am.h
+++ b/src/dbinc/db_am.h
@@ -1,7 +1,7 @@
/*-
* See the file LICENSE for redistribution information.
*
- * Copyright (c) 1996, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
@@ -199,12 +199,16 @@ struct __db_foreign_info {
#define DB_IS_PRIMARY(dbp) (LIST_FIRST(&dbp->s_secondaries) != NULL)
/*
* A database should be required to be readonly if it's been explicitly
- * specified as such or if we're a client in a replicated environment
- * and the user did not specify DB_TXN_NOT_DURABLE.
+ * specified as such, if we're a client in a replicated environment
+ * and the user did not specify DB_TXN_NOT_DURABLE, or if we're a master
+ * in a replicated environment and the REP_F_READONLY_MASTER flag has been
+ * set in preparation for a preferred master takeover.
*/
#define DB_IS_READONLY(dbp) \
(F_ISSET(dbp, DB_AM_RDONLY) || \
- (IS_REP_CLIENT((dbp)->env) && !F_ISSET((dbp), DB_AM_NOT_DURABLE)))
+ (IS_REP_CLIENT((dbp)->env) && !F_ISSET((dbp), DB_AM_NOT_DURABLE)) \
+ || (IS_REP_MASTER((dbp)->env) && \
+ F_ISSET((dbp)->env->rep_handle->region, REP_F_READONLY_MASTER)))
#ifdef HAVE_COMPRESSION
/*