diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2020-04-30 17:41:41 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-30 22:03:40 +0000 |
commit | d43a9f044f9a25980c467f8b7922ad691f517803 (patch) | |
tree | 8dab1d64ed6a97f03cf8ad54990a5ba3b89bfd5f /src/mongo/db/repl/member_config.idl | |
parent | 39a6dfded77db512ddb729e202b13562bba4c58f (diff) | |
download | mongo-d43a9f044f9a25980c467f8b7922ad691f517803.tar.gz |
SERVER-47090 Create IDL for ReplSetConfig
Diffstat (limited to 'src/mongo/db/repl/member_config.idl')
-rw-r--r-- | src/mongo/db/repl/member_config.idl | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/src/mongo/db/repl/member_config.idl b/src/mongo/db/repl/member_config.idl new file mode 100644 index 00000000000..946028f6a23 --- /dev/null +++ b/src/mongo/db/repl/member_config.idl @@ -0,0 +1,120 @@ +# Copyright (C) 2020-present MongoDB, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the Server Side Public License, version 1, +# as published by MongoDB, Inc. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# Server Side Public License for more details. +# +# You should have received a copy of the Server Side Public License +# along with this program. If not, see +# <http://www.mongodb.com/licensing/server-side-public-license>. +# +# As a special exception, the copyright holders give permission to link the +# code of portions of this program with the OpenSSL library under certain +# conditions as described in each individual source file and distribute +# linked combinations including the program with the OpenSSL library. You +# must comply with the Server Side Public License in all respects for +# all of the code used other than as permitted herein. If you modify file(s) +# with this exception, you may extend this exception to your version of the +# file(s), but you are not obligated to do so. If you do not wish to do so, +# delete this exception statement from your version. If you delete this +# exception statement from all source files in the program, then also delete +# it in the license file. +# + +# This file must be separate from repl_set_config.idl to avoid circular includes between +# member_config.h and repl_set_config_gen.h + +global: + cpp_namespace: "mongo::repl" + cpp_includes: + - "mongo/db/repl/member_id.h" + - "mongo/db/repl/repl_set_config_validators.h" + + +imports: + - "mongo/idl/basic_types.idl" + +types: + memberId: + bson_serialization_type: any + description: A wrapper around an integer for the MemberId of a MemberConfig. + cpp_type: "MemberId" + serializer: MemberId::serializeToBSON + deserializer: MemberId::parseFromBSON + + memberConfig: + bson_serialization_type: object + description: "A single member in the replica set configuration" + cpp_type: MemberConfig + serializer: MemberConfig::toBSON + deserializer: MemberConfig::parseFromBSON + +structs: + MemberConfigBase: + description: "The configuration for a given member inside of the replica set config" + fields: + _id: + cpp_name: id + type: memberId + description: "An integer identifier of every member in the replica set" + host: + type: string + description: "The hostname and, if specified, the port number, of the set member" + votes: + type: safeInt64 + default: 1 + validator: { gte: 0, lte: 1 } + description: "The number of votes a server will cast in a replica set election. The + number of votes each member has is either 1 or 0, and arbiters always + have exactly 1 vote" + newlyAdded: + type: bool + optional: true + validator: { callback: "validateTrue" } + description: "Set to true if the member was just added and is in initial sync. + Must be true when specified. Indicates that the votes and priority + fields should be considered '0' for the duration of the initial sync" + priority: + type: safeDouble + default: 1.0 + validator: { gte: 0, lte: 1000 } + description: "A number that indicates the relative eligibility of a member to become + a primary" + hidden: + type: safeBool + default: false + description: "When this value is true, the replica set hides this instance and does + not include the member in the output of db.isMaster() or isMaster. This + prevents read operations (i.e. queries) from ever reaching this host by + way of secondary read preference" + slaveDelay: + cpp_name: slaveDelaySecs + type: safeInt64 + default: 0 + validator: { gte: 0, lte: 31622400 } + description: "The number of seconds 'behind' the primary that this replica set + member should 'lag'" + arbiterOnly: + type: safeBool + default: false + description: "A boolean that identifies an arbiter. A value of true indicates that + the member is an arbiter" + buildIndexes: + type: safeBool + default: true + description: "A boolean that indicates whether the mongod builds indexes on this + member" + tags: + type: object_owned + optional: true + description: "A tags document contains user-defined tag field and value pairs for + the replica set member" + horizons: + type: object + optional: true + description: "The hostnames for the provided horizons" |