~evarlast/ubuntu/utopic/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to src/mongo/db/repl/rs_config.h

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        // Protects _groups.
37
37
        static mongo::mutex groupMx;
38
38
    public:
39
 
        ReplSetConfig();
40
39
        /**
41
40
         * This contacts the given host and tries to get a config from them.
42
41
         *
48
47
         * reasons.) If something is misconfigured, throws an exception. If the
49
48
         * host couldn't be queried or is just blank, ok() will be false.
50
49
         */
51
 
        ReplSetConfig(const HostAndPort& h);
52
 
 
53
 
        ReplSetConfig(BSONObj cfg, bool force=false);
 
50
        static ReplSetConfig* make(const HostAndPort& h);
 
51
 
 
52
        static ReplSetConfig* make(BSONObj cfg, bool force=false);
 
53
 
 
54
        /**
 
55
         * This uses DBDirectClient to check itself for a config.  This way we don't need to connect
 
56
         * to ourselves over the network to fetch our own config.
 
57
         */
 
58
        static ReplSetConfig* makeDirect();
54
59
 
55
60
        bool ok() const { return _ok; }
56
61
 
156
161
        bool _constructed;
157
162
 
158
163
        /**
 
164
         * Get the timeout to use for heartbeats.
 
165
         */
 
166
        int getHeartbeatTimeout() const;
 
167
 
 
168
        /**
 
169
         * Default timeout: 10 seconds
 
170
         */
 
171
        static const int DEFAULT_HB_TIMEOUT;
 
172
 
 
173
        /**
159
174
         * Returns if replication chaining is allowed.
160
175
         */
161
176
        bool chainingAllowed() const;
162
177
 
163
178
    private:
164
 
        bool _ok;
 
179
        ReplSetConfig();
 
180
        void init(const HostAndPort& h);
 
181
        void init(BSONObj cfg, bool force);
165
182
 
166
183
        /**
167
184
         * If replication can be chained. If chaining is disallowed, it can still be explicitly
169
186
         */
170
187
        bool _chainingAllowed;
171
188
        int _majority;
 
189
        bool _ok;
172
190
 
173
191
        void from(BSONObj);
174
192
        void clear();
176
194
        struct TagClause;
177
195
 
178
196
        /**
 
197
         * The timeout to use for heartbeats
 
198
         */
 
199
        int _heartbeatTimeout;
 
200
 
 
201
        /**
179
202
         * This is a logical grouping of servers.  It is pointed to by a set of
180
203
         * servers with a certain tag.
181
204
         *
187
210
         */
188
211
        struct TagSubgroup : boost::noncopyable {
189
212
            ~TagSubgroup(); // never called; not defined
190
 
            TagSubgroup(string nm) : name(nm) { }
 
213
            TagSubgroup(const std::string& nm) : name(nm) { }
191
214
            const string name;
192
215
            OpTime last;
193
216
            vector<TagClause*> clauses;