summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/repl_settings.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-10-05 15:32:48 -0400
committerMathias Stearn <mathias@10gen.com>2015-10-08 12:06:52 -0400
commit5be08a11886329994ee73950f031c2ee3b4c9309 (patch)
treefef315b7f81e70c59af2e1fd6db1e0a2f08747f7 /src/mongo/db/repl/repl_settings.h
parent804ad14001e1a58538974a327e9943c338fd0925 (diff)
downloadmongo-5be08a11886329994ee73950f031c2ee3b4c9309.tar.gz
SERVER-20707 Add --enableMajorityReadConcern option
Diffstat (limited to 'src/mongo/db/repl/repl_settings.h')
-rw-r--r--src/mongo/db/repl/repl_settings.h84
1 files changed, 25 insertions, 59 deletions
diff --git a/src/mongo/db/repl/repl_settings.h b/src/mongo/db/repl/repl_settings.h
index 1ce5fa6b4dc..cd5a67d52e4 100644
--- a/src/mongo/db/repl/repl_settings.h
+++ b/src/mongo/db/repl/repl_settings.h
@@ -49,82 +49,48 @@ typedef enum { NotSlave = 0, SimpleSlave } SlaveTypes;
class ReplSettings {
public:
- SlaveTypes slave;
+ std::string ourSetName() const {
+ std::string setname;
+ size_t sl = replSet.find('/');
+ if (sl == std::string::npos)
+ return replSet;
+ return replSet.substr(0, sl);
+ }
+ bool usingReplSets() const {
+ return !replSet.empty();
+ }
+
+ SlaveTypes slave = NotSlave;
/**
* true means we are master and doing replication. if we are not writing to oplog, this won't
* be true.
*/
- bool master;
+ bool master = false;
+
+ bool fastsync = false;
- bool fastsync;
+ bool autoresync = false;
- bool autoresync;
+ int slavedelay = 0;
- int slavedelay;
+ long long oplogSize = 0; // --oplogSize
- long long oplogSize; // --oplogSize
+ /**
+ * True means that the majorityReadConcern feature is enabled, either explicitly by the user or
+ * implicitly by a requiring feature such as CSRS. It does not mean that the storage engine
+ * supports snapshots or that the snapshot thread is running. Those are tracked separately.
+ */
+ bool majorityReadConcernEnabled = false;
// for master/slave replication
std::string source; // --source
std::string only; // --only
- int pretouch; // --pretouch for replication application (experimental)
+ int pretouch = 0; // --pretouch for replication application (experimental)
std::string replSet; // --replSet[/<seedlist>]
- std::string ourSetName() const {
- std::string setname;
- size_t sl = replSet.find('/');
- if (sl == std::string::npos)
- return replSet;
- return replSet.substr(0, sl);
- }
- bool usingReplSets() const {
- return !replSet.empty();
- }
std::string rsIndexPrefetch; // --indexPrefetch
-
- ReplSettings()
- : slave(NotSlave),
- master(false),
- fastsync(),
- autoresync(false),
- slavedelay(),
- oplogSize(0),
- pretouch(0) {}
-
- // TODO(spencer): Remove explicit copy constructor after we no longer have mutable state
- // in ReplSettings.
- ReplSettings(const ReplSettings& other)
- : slave(other.slave),
- master(other.master),
- fastsync(other.fastsync),
- autoresync(other.autoresync),
- slavedelay(other.slavedelay),
- oplogSize(other.oplogSize),
- source(other.source),
- only(other.only),
- pretouch(other.pretouch),
- replSet(other.replSet),
- rsIndexPrefetch(other.rsIndexPrefetch) {}
-
- ReplSettings& operator=(const ReplSettings& other) {
- if (this == &other)
- return *this;
-
- slave = other.slave;
- master = other.master;
- fastsync = other.fastsync;
- autoresync = other.autoresync;
- slavedelay = other.slavedelay;
- oplogSize = other.oplogSize;
- source = other.source;
- only = other.only;
- pretouch = other.pretouch;
- replSet = other.replSet;
- rsIndexPrefetch = other.rsIndexPrefetch;
- return *this;
- }
};
} // namespace repl