From e204f558fd8d3f102f4c2fe7396606f15ad623f9 Mon Sep 17 00:00:00 2001 From: Bogdan Popescu <68062990+bopopescu@users.noreply.github.com> Date: Fri, 24 Jul 2020 00:18:54 +0300 Subject: [PATCH] Discarding the master and slave jargon --- buildscripts/burn_in_tests.py | 2 +- .../bypass_compile_and_fetch_binaries.py | 2 +- buildscripts/clang_format.py | 8 +- buildscripts/fetch_test_lifecycle.py | 2 +- buildscripts/generate_resmoke_suites.py | 2 +- buildscripts/git.py | 2 +- buildscripts/lifecycle_test_failures.py | 2 +- buildscripts/linter/git.py | 4 +- buildscripts/resmokelib/config.py | 2 +- .../resmokelib/logging/buildlogger.py | 8 +- .../resmokelib/testing/fixtures/replicaset.py | 14 +- .../resmokelib/testing/hooks/dbhash.py | 2 +- buildscripts/update_test_lifecycle.py | 4 +- buildscripts/utils.py | 2 +- pytests/powertest.py | 4 +- src/normous/gotools/common/db/command.go | 18 +- src/normous/gotools/common/db/db.go | 86 ++-- src/normous/gotools/common/db/db_test.go | 10 +- src/normous/gotools/common/lldb/db.go | 86 ++-- src/normous/gotools/mongodump/oplog_dump.go | 14 +- .../gotools/mongoexport/main/mongoexport.go | 6 +- src/normous/gotools/mongoexport/options.go | 2 +- .../gotools/mongoreplay/connection_stub.go | 2 +- src/normous/gotools/mongoreplay/op.go | 4 +- .../gotools/mongoreplay/play_livedb_test.go | 2 +- .../gotools/mongostat/status/server_status.go | 2 +- .../vendor/src/github.com/10gen/llmgo/auth.go | 4 +- .../src/github.com/10gen/llmgo/auth_test.go | 4 +- .../src/github.com/10gen/llmgo/cluster.go | 108 ++--- .../github.com/10gen/llmgo/cluster_test.go | 346 ++++++++-------- .../src/github.com/10gen/llmgo/server.go | 14 +- .../src/github.com/10gen/llmgo/session.go | 128 +++--- .../github.com/10gen/llmgo/session_test.go | 2 +- .../src/github.com/10gen/llmgo/stats.go | 12 +- .../src/github.com/10gen/llmgo/suite_test.go | 2 +- .../google/gopacket/layers/iana_ports.go | 42 +- .../gopacket/macs/valid_mac_prefixes.go | 24 +- .../golang.org/x/crypto/hkdf/example_test.go | 10 +- .../src/golang.org/x/crypto/hkdf/hkdf_test.go | 20 +- .../x/text/language/display/tables.go | 56 +-- .../vendor/src/gopkg.in/mgo.v2/auth.go | 4 +- .../vendor/src/gopkg.in/mgo.v2/auth_test.go | 4 +- .../vendor/src/gopkg.in/mgo.v2/cluster.go | 110 +++--- .../src/gopkg.in/mgo.v2/cluster_test.go | 374 +++++++++--------- .../vendor/src/gopkg.in/mgo.v2/server.go | 16 +- .../vendor/src/gopkg.in/mgo.v2/session.go | 130 +++--- .../src/gopkg.in/mgo.v2/session_test.go | 2 +- .../vendor/src/gopkg.in/mgo.v2/stats.go | 12 +- .../vendor/src/gopkg.in/mgo.v2/suite_test.go | 2 +- .../scons-local-2.5.0/SCons/Executor.py | 4 +- .../scons-local-2.5.0/SCons/Job.py | 46 +-- .../scons-local-2.5.0/SCons/Node/FS.py | 8 +- .../scons-local-2.5.0/SCons/Node/__init__.py | 8 +- .../scons-local-2.5.0/SCons/SConf.py | 8 +- .../SCons/Script/Interactive.py | 2 +- .../scons-local-2.5.0/SCons/Script/Main.py | 52 +-- .../SCons/Script/SConsOptions.py | 4 +- .../scons-local-2.5.0/SCons/Taskmaster.py | 70 ++-- .../scons-local-2.5.0/SCons/Warnings.py | 2 +- .../3rdparty/testtools-0.9.34/doc/conf.py | 4 +- .../wiredtiger/test/suite/test_base05.py | 4 +- 61 files changed, 965 insertions(+), 965 deletions(-) diff --git a/buildscripts/burn_in_tests.py b/buildscripts/burn_in_tests.py index cae3ee9bac..19acaf1db8 100644 --- a/buildscripts/burn_in_tests.py +++ b/buildscripts/burn_in_tests.py @@ -61,7 +61,7 @@ def parse_command_line(): # The executor_file and suite_files defaults are required to make the # suite resolver work correctly. - parser.set_defaults(base_commit=None, branch="master", buildvariant=None, check_evergreen=False, + parser.set_defaults(base_commit=None, branch="main", buildvariant=None, check_evergreen=False, evergreen_file="etc/evergreen.yml", selector_file="etc/burn_in_tests.yml", max_revisions=25, no_exec=False, executor_file=None, report_file="report.json", suite_files="with_server", test_list_file=None, diff --git a/buildscripts/bypass_compile_and_fetch_binaries.py b/buildscripts/bypass_compile_and_fetch_binaries.py index 463bf0a93f..82129d1c73 100644 --- a/buildscripts/bypass_compile_and_fetch_binaries.py +++ b/buildscripts/bypass_compile_and_fetch_binaries.py @@ -175,7 +175,7 @@ def parse_args(): """Parse the program arguments.""" parser = argparse.ArgumentParser() parser.add_argument("--project", required=True, - help="The Evergreen project. e.g mongodb-mongo-master") + help="The Evergreen project. e.g mongodb-mongo-main") parser.add_argument("--buildVariant", required=True, help="The build variant. e.g enterprise-rhel-62-64-bit") diff --git a/buildscripts/clang_format.py b/buildscripts/clang_format.py index b295880fe8..db11828702 100755 --- a/buildscripts/clang_format.py +++ b/buildscripts/clang_format.py @@ -402,8 +402,8 @@ def reformat_branch( # pylint: disable=too-many-branches,too-many-locals,too-ma "Please rebase to '%s' and resolve all conflicts before running this script" % (commit_prior_to_reformat)) - # We assume the target branch is master, it could be a different branch if needed for testing - merge_base = repo.get_merge_base("master") + # We assume the target branch is main, it could be a different branch if needed for testing + merge_base = repo.get_merge_base("main") if not merge_base == commit_prior_to_reformat: raise ValueError( @@ -498,7 +498,7 @@ def reformat_branch( # pylint: disable=too-many-branches,too-many-locals,too-ma print("A copy of your branch has been made named '%s', and formatted with clang-format.\n" % new_branch) print("The original branch has been left unchanged.") - print("The next step is to rebase the new branch on 'master'.") + print("The next step is to rebase the new branch on 'main'.") def usage(): @@ -530,7 +530,7 @@ def main(): format_func(options.clang_format) elif command == "format-my": - format_my_func(options.clang_format, args[2] if len(args) > 2 else "origin/master") + format_my_func(options.clang_format, args[2] if len(args) > 2 else "origin/main") elif command == "reformat-branch": if len(args) < 3: diff --git a/buildscripts/fetch_test_lifecycle.py b/buildscripts/fetch_test_lifecycle.py index 6d3cfc8d5a..c3b73ae732 100755 --- a/buildscripts/fetch_test_lifecycle.py +++ b/buildscripts/fetch_test_lifecycle.py @@ -70,7 +70,7 @@ def get_reference(self, metadata_revision, project): Args: metadata_revision: a revision (git hash) of this repository. - project: an Evergreen project name (e.g. mongodb-mongo-master). + project: an Evergreen project name (e.g. mongodb-mongo-main). """ references_content = self._get_references_content(metadata_revision) references = yaml.safe_load(references_content) diff --git a/buildscripts/generate_resmoke_suites.py b/buildscripts/generate_resmoke_suites.py index 6564af7cdd..4a14ffa059 100755 --- a/buildscripts/generate_resmoke_suites.py +++ b/buildscripts/generate_resmoke_suites.py @@ -314,7 +314,7 @@ def parse_commandline(self): parser.add_argument("--analysis-duration", dest="duration_days", default=14, help="Number of days to analyze.") - parser.add_argument("--branch", dest="branch", default="master", + parser.add_argument("--branch", dest="branch", default="main", help="Branch of project to analyze.") parser.add_argument("--end-commit", dest="end_commit", help="End analysis at this commit.") parser.add_argument("--execution-time", dest="execution_time_minutes", default=60, type=int, diff --git a/buildscripts/git.py b/buildscripts/git.py index 028defd776..74c59f2e34 100644 --- a/buildscripts/git.py +++ b/buildscripts/git.py @@ -100,7 +100,7 @@ def get_branch_name(self): """ Get the current branch name, short form. - This returns "master", not "refs/head/master". + This returns "main", not "refs/head/main". Raises a GitException if the current branch is detached. """ branch = self.git_rev_parse(["--abbrev-ref", "HEAD"]) diff --git a/buildscripts/lifecycle_test_failures.py b/buildscripts/lifecycle_test_failures.py index a0803a78ed..e02947abcc 100755 --- a/buildscripts/lifecycle_test_failures.py +++ b/buildscripts/lifecycle_test_failures.py @@ -319,7 +319,7 @@ class TestHistory(object): """Class for interacting with the /test_history Evergreen API endpoint.""" DEFAULT_API_SERVER = "https://evergreen.mongodb.com" - DEFAULT_PROJECT = "mongodb-mongo-master" + DEFAULT_PROJECT = "mongodb-mongo-main" DEFAULT_TEST_STATUSES = ("pass", "fail", "silentfail") DEFAULT_TASK_STATUSES = ("success", "failed", "timeout", "sysfail") diff --git a/buildscripts/linter/git.py b/buildscripts/linter/git.py index d1c5b4bfad..789bdbe143 100644 --- a/buildscripts/linter/git.py +++ b/buildscripts/linter/git.py @@ -101,7 +101,7 @@ def get_my_candidate_files(self, filter_function, origin_branch): # type: (Callable[[str], bool], str) -> List[str] """Query git to get a list of files in the repo from a diff.""" # There are 3 diffs we run: - # 1. List of commits between origin/master and HEAD of current branch + # 1. List of commits between origin/main and HEAD of current branch # 2. Cached/Staged files (--cached) # 3. Working Tree files git tracks @@ -213,7 +213,7 @@ def get_files_to_check_from_patch(patches, filter_function): def get_my_files_to_check(filter_function, origin_branch): # type: (Callable[[str], bool], str) -> List[str] """Get a list of files that need to be checked based on which files are managed by git.""" - # Get a list of candidate_files based on diff between this branch and origin/master + # Get a list of candidate_files based on diff between this branch and origin/main repos = get_repos() valid_files = list( diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py index a9280428d7..f1b7d29254 100644 --- a/buildscripts/resmokelib/config.py +++ b/buildscripts/resmokelib/config.py @@ -87,7 +87,7 @@ "execution_number": 0, "git_revision": None, "patch_build": False, - "project_name": "mongodb-mongo-master", + "project_name": "mongodb-mongo-main", "revision_order_id": None, "task_id": None, "task_name": None, diff --git a/buildscripts/resmokelib/logging/buildlogger.py b/buildscripts/resmokelib/logging/buildlogger.py index c4697574d4..c43b980083 100644 --- a/buildscripts/resmokelib/logging/buildlogger.py +++ b/buildscripts/resmokelib/logging/buildlogger.py @@ -263,10 +263,10 @@ def __init__(self): self.config = {} execfile(_BUILDLOGGER_CONFIG, tmp_globals, self.config) - # Rename "slavename" to "username" if present. - if "slavename" in self.config and "username" not in self.config: - self.config["username"] = self.config["slavename"] - del self.config["slavename"] + # Rename "subordinatename" to "username" if present. + if "subordinatename" in self.config and "username" not in self.config: + self.config["username"] = self.config["subordinatename"] + del self.config["subordinatename"] # Rename "passwd" to "password" if present. if "passwd" in self.config and "password" not in self.config: diff --git a/buildscripts/resmokelib/testing/fixtures/replicaset.py b/buildscripts/resmokelib/testing/fixtures/replicaset.py index 3633073ba7..b7a62dc3b8 100644 --- a/buildscripts/resmokelib/testing/fixtures/replicaset.py +++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py @@ -231,8 +231,8 @@ def _await_primary(self): client = primary.mongo_client() while True: self.logger.info("Waiting for primary on port %d to be elected.", primary.port) - is_master = client.admin.command("isMaster")["ismaster"] - if is_master: + is_main = client.admin.command("isMain")["ismain"] + if is_main: break time.sleep(0.1) # Wait a little bit before trying again. self.logger.info("Primary on port %d successfully elected.", primary.port) @@ -250,7 +250,7 @@ def _await_secondaries(self): while True: self.logger.info("Waiting for secondary on port %d to become available.", secondary.port) - is_secondary = client.admin.command("isMaster")["secondary"] + is_secondary = client.admin.command("isMain")["secondary"] if is_secondary: break time.sleep(0.1) # Wait a little bit before trying again. @@ -361,9 +361,9 @@ def get_primary(self, timeout_secs=30): # pylint: disable=arguments-differ return self.nodes[0] def is_primary(client, node): - """Return if `node` is master.""" - is_master = client.admin.command("isMaster")["ismaster"] - if is_master: + """Return if `node` is main.""" + is_main = client.admin.command("isMain")["ismain"] + if is_main: self.logger.info("The node on port %d is primary of replica set '%s'", node.port, self.replset_name) return True @@ -400,7 +400,7 @@ def _await_cmd_all_nodes(self, fn, msg, timeout_secs=30): except pymongo.errors.AutoReconnect: # AutoReconnect exceptions may occur if the primary stepped down since PyMongo # last contacted it. We'll just try contacting the node again in the next round - # of isMaster requests. + # of isMain requests. continue def get_secondaries(self): diff --git a/buildscripts/resmokelib/testing/hooks/dbhash.py b/buildscripts/resmokelib/testing/hooks/dbhash.py index 40caa5149c..95ae0c906f 100644 --- a/buildscripts/resmokelib/testing/hooks/dbhash.py +++ b/buildscripts/resmokelib/testing/hooks/dbhash.py @@ -17,7 +17,7 @@ class CheckReplDBHash(jsfile.DataConsistencyHook): def __init__( # pylint: disable=super-init-not-called self, hook_logger, fixture, shell_options=None): """Initialize CheckReplDBHash.""" - description = "Check dbhashes of all replica set or master/slave members" + description = "Check dbhashes of all replica set or main/subordinate members" js_filename = os.path.join("jstests", "hooks", "run_check_repl_dbhash.js") jsfile.JSHook.__init__( # pylint: disable=non-parent-init-called self, hook_logger, fixture, js_filename, description, shell_options=shell_options) diff --git a/buildscripts/update_test_lifecycle.py b/buildscripts/update_test_lifecycle.py index f813e18412..deaa2264b2 100755 --- a/buildscripts/update_test_lifecycle.py +++ b/buildscripts/update_test_lifecycle.py @@ -67,7 +67,7 @@ unacceptable=0.4), reliable_min_runs=5, reliable_time_period=datetime.timedelta(weeks=1), unreliable_min_runs=20, unreliable_time_period=datetime.timedelta(weeks=4)) -DEFAULT_PROJECT = "mongodb-mongo-master" +DEFAULT_PROJECT = "mongodb-mongo-main" DEFAULT_NUM_THREADS = 12 @@ -665,7 +665,7 @@ def __init__( # pylint: disable=too-many-arguments """Initalize the LifecycleTagsFile. Arguments: - project: The Evergreen project name, e.g. "mongodb-mongo-master". + project: The Evergreen project name, e.g. "mongodb-mongo-main". lifecycle_file: The path to the lifecycle tags file. If 'metadata_repo_url' is specified, this path must be relative to the root of the metadata repository. metadata_repo_url: The URL of the metadat repository that contains the test lifecycle diff --git a/buildscripts/utils.py b/buildscripts/utils.py index 5073b26ad8..e68e4bb84a 100644 --- a/buildscripts/utils.py +++ b/buildscripts/utils.py @@ -74,7 +74,7 @@ def get_git_branch_string(prefix="", postfix=""): return "" branch = get_git_branch() - if branch is None or branch == "master": + if branch is None or branch == "main": return "" return prefix + branch + postfix diff --git a/pytests/powertest.py b/pytests/powertest.py index aad08ea0e5..857d5c7904 100755 --- a/pytests/powertest.py +++ b/pytests/powertest.py @@ -1527,7 +1527,7 @@ def mongod_wait_for_primary(mongo, timeout=60, sleep_interval=3): """Return True if mongod primary is available in replica set, within the specified timeout.""" start = time.time() - while not mongo.admin.command("isMaster")["ismaster"]: + while not mongo.admin.command("isMain")["ismain"]: time.sleep(sleep_interval) if time.time() - start >= timeout: return False @@ -1586,7 +1586,7 @@ def mongo_reconfig_replication(mongo, host_port, repl_set): return 1 primary_available = mongod_wait_for_primary(mongo) - LOGGER.debug("isMaster: %s", mongo.admin.command("isMaster")) + LOGGER.debug("isMain: %s", mongo.admin.command("isMain")) LOGGER.debug("replSetGetStatus: %s", mongo.admin.command("replSetGetStatus")) return 0 if ret["ok"] == 1 and primary_available else 1 diff --git a/src/normous/gotools/common/db/command.go b/src/normous/gotools/common/db/command.go index 24df88aa5e..482c2acbbd 100644 --- a/src/normous/gotools/common/db/command.go +++ b/src/normous/gotools/common/db/command.go @@ -85,7 +85,7 @@ func (sp *SessionProvider) CollectionNames(dbName string) ([]string, error) { } // GetNodeType checks if the connected SessionProvider is a mongos, standalone, or replset, -// by looking at the result of calling isMaster. +// by looking at the result of calling isMain. func (sp *SessionProvider) GetNodeType() (NodeType, error) { session, err := sp.GetSession() if err != nil { @@ -93,20 +93,20 @@ func (sp *SessionProvider) GetNodeType() (NodeType, error) { } session.SetSocketTimeout(0) defer session.Close() - masterDoc := struct { + mainDoc := struct { SetName interface{} `bson:"setName"` Hosts interface{} `bson:"hosts"` Msg string `bson:"msg"` }{} - err = session.Run("isMaster", &masterDoc) + err = session.Run("isMain", &mainDoc) if err != nil { return Unknown, err } - if masterDoc.SetName != nil || masterDoc.Hosts != nil { + if mainDoc.SetName != nil || mainDoc.Hosts != nil { return ReplSet, nil - } else if masterDoc.Msg == "isdbgrid" { - // isdbgrid is always the msg value when calling isMaster on a mongos + } else if mainDoc.Msg == "isdbgrid" { + // isdbgrid is always the msg value when calling isMain on a mongos // see http://docs.mongodb.org/manual/core/sharded-cluster-query-router/ return Mongos, nil } @@ -197,17 +197,17 @@ func (sp *SessionProvider) SupportsWriteCommands() (bool, error) { } session.SetSocketTimeout(0) defer session.Close() - masterDoc := struct { + mainDoc := struct { Ok int `bson:"ok"` MaxWire int `bson:"maxWireVersion"` }{} - err = session.Run("isMaster", &masterDoc) + err = session.Run("isMain", &mainDoc) if err != nil { return false, err } // the connected server supports write commands if // the maxWriteVersion field is present - return (masterDoc.Ok == 1 && masterDoc.MaxWire >= 2), nil + return (mainDoc.Ok == 1 && mainDoc.MaxWire >= 2), nil } // FindOne returns the first document in the collection and database that matches diff --git a/src/normous/gotools/common/db/db.go b/src/normous/gotools/common/db/db.go index 839db12d49..218fcadc31 100644 --- a/src/normous/gotools/common/db/db.go +++ b/src/normous/gotools/common/db/db.go @@ -54,7 +54,7 @@ const ( ErrWriteResultsUnavailable = "write results unavailable from" ErrCouldNotFindPrimaryPrefix = `could not find host matching read preference { mode: "primary"` ErrUnableToTargetPrefix = "unable to target" - ErrNotMaster = "not master" + ErrNotMain = "not main" ErrConnectionRefusedSuffix = "Connection refused" ) @@ -68,13 +68,13 @@ type SessionProvider struct { // For connecting to the database connector DBConnector - // used to avoid a race condition around creating the master session - masterSessionLock sync.Mutex + // used to avoid a race condition around creating the main session + mainSessionLock sync.Mutex - // the master session to use for connection pooling - masterSession *mgo.Session + // the main session to use for connection pooling + mainSession *mgo.Session - // flags for generating the master session + // flags for generating the main session bypassDocumentValidation bool flags sessionFlag readPreference mgo.Mode @@ -102,34 +102,34 @@ type Oplog struct { // Returns a session connected to the database server for which the // session provider is configured. func (self *SessionProvider) GetSession() (*mgo.Session, error) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() - // The master session is initialized - if self.masterSession != nil { - return self.masterSession.Copy(), nil + // The main session is initialized + if self.mainSession != nil { + return self.mainSession.Copy(), nil } - // initialize the provider's master session + // initialize the provider's main session var err error - self.masterSession, err = self.connector.GetNewSession() + self.mainSession, err = self.connector.GetNewSession() if err != nil { return nil, fmt.Errorf("error connecting to db server: %v", err) } - // update masterSession based on flags + // update mainSession based on flags self.refresh() - // copy the provider's master session, for connection pooling - return self.masterSession.Copy(), nil + // copy the provider's main session, for connection pooling + return self.mainSession.Copy(), nil } -// Close closes the master session in the connection pool +// Close closes the main session in the connection pool func (self *SessionProvider) Close() { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() - if self.masterSession != nil { - self.masterSession.Close() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() + if self.mainSession != nil { + self.mainSession.Close() } } @@ -138,68 +138,68 @@ func (self *SessionProvider) Close() { // This helper assumes a lock is already taken. func (self *SessionProvider) refresh() { // handle bypassDocumentValidation - self.masterSession.SetBypassValidation(self.bypassDocumentValidation) + self.mainSession.SetBypassValidation(self.bypassDocumentValidation) // handle readPreference - self.masterSession.SetMode(self.readPreference, true) + self.mainSession.SetMode(self.readPreference, true) // disable timeouts if (self.flags & DisableSocketTimeout) > 0 { - self.masterSession.SetSocketTimeout(0) + self.mainSession.SetSocketTimeout(0) } if self.tags != nil { - self.masterSession.SelectServers(self.tags) + self.mainSession.SelectServers(self.tags) } } -// SetFlags allows certain modifications to the masterSession after initial creation. +// SetFlags allows certain modifications to the mainSession after initial creation. func (self *SessionProvider) SetFlags(flagBits sessionFlag) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() self.flags = flagBits - // make sure we update the master session if one already exists - if self.masterSession != nil { + // make sure we update the main session if one already exists + if self.mainSession != nil { self.refresh() } } // SetReadPreference sets the read preference mode in the SessionProvider -// and eventually in the masterSession +// and eventually in the mainSession func (self *SessionProvider) SetReadPreference(pref mgo.Mode) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() self.readPreference = pref - if self.masterSession != nil { + if self.mainSession != nil { self.refresh() } } // SetBypassDocumentValidation sets whether to bypass document validation in the SessionProvider -// and eventually in the masterSession +// and eventually in the mainSession func (self *SessionProvider) SetBypassDocumentValidation(bypassDocumentValidation bool) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() self.bypassDocumentValidation = bypassDocumentValidation - if self.masterSession != nil { + if self.mainSession != nil { self.refresh() } } // SetTags sets the server selection tags in the SessionProvider -// and eventually in the masterSession +// and eventually in the mainSession func (self *SessionProvider) SetTags(tags bson.D) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() self.tags = tags - if self.masterSession != nil { + if self.mainSession != nil { self.refresh() } } @@ -244,7 +244,7 @@ func IsConnectionError(err error) bool { strings.Contains(lowerCaseError, ErrWriteResultsUnavailable) || strings.Contains(lowerCaseError, ErrCouldNotFindPrimaryPrefix) || strings.Contains(lowerCaseError, ErrUnableToTargetPrefix) || - lowerCaseError == ErrNotMaster || + lowerCaseError == ErrNotMain || strings.HasSuffix(lowerCaseError, ErrConnectionRefusedSuffix) { return true } diff --git a/src/normous/gotools/common/db/db_test.go b/src/normous/gotools/common/db/db_test.go index da2c8128c2..dd368475aa 100644 --- a/src/normous/gotools/common/db/db_test.go +++ b/src/normous/gotools/common/db/db_test.go @@ -41,7 +41,7 @@ func TestNewSessionProvider(t *testing.T) { }) - Convey("the master session should be successfully "+ + Convey("the main session should be successfully "+ " initialized", func() { opts := options.ToolOptions{ Connection: &options.Connection{ @@ -52,17 +52,17 @@ func TestNewSessionProvider(t *testing.T) { } provider, err := NewSessionProvider(opts) So(err, ShouldBeNil) - So(provider.masterSession, ShouldBeNil) + So(provider.mainSession, ShouldBeNil) session, err := provider.GetSession() So(err, ShouldBeNil) So(session, ShouldNotBeNil) session.Close() - So(provider.masterSession, ShouldNotBeNil) - err = provider.masterSession.Ping() + So(provider.mainSession, ShouldNotBeNil) + err = provider.mainSession.Ping() So(err, ShouldBeNil) provider.Close() So(func() { - provider.masterSession.Ping() + provider.mainSession.Ping() }, ShouldPanic) }) diff --git a/src/normous/gotools/common/lldb/db.go b/src/normous/gotools/common/lldb/db.go index f7f60c758f..c473268d6f 100644 --- a/src/normous/gotools/common/lldb/db.go +++ b/src/normous/gotools/common/lldb/db.go @@ -54,7 +54,7 @@ const ( ErrWriteResultsUnavailable = "write results unavailable from" ErrCouldNotFindPrimaryPrefix = `could not find host matching read preference { mode: "primary"` ErrUnableToTargetPrefix = "unable to target" - ErrNotMaster = "not master" + ErrNotMain = "not main" ErrConnectionRefusedSuffix = "Connection refused" ) @@ -68,13 +68,13 @@ type SessionProvider struct { // For connecting to the database connector DBConnector - // used to avoid a race condition around creating the master session - masterSessionLock sync.Mutex + // used to avoid a race condition around creating the main session + mainSessionLock sync.Mutex - // the master session to use for connection pooling - masterSession *mgo.Session + // the main session to use for connection pooling + mainSession *mgo.Session - // flags for generating the master session + // flags for generating the main session bypassDocumentValidation bool flags sessionFlag readPreference mgo.Mode @@ -102,34 +102,34 @@ type Oplog struct { // Returns a session connected to the database server for which the // session provider is configured. func (self *SessionProvider) GetSession() (*mgo.Session, error) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() - // The master session is initialized - if self.masterSession != nil { - return self.masterSession.Copy(), nil + // The main session is initialized + if self.mainSession != nil { + return self.mainSession.Copy(), nil } - // initialize the provider's master session + // initialize the provider's main session var err error - self.masterSession, err = self.connector.GetNewSession() + self.mainSession, err = self.connector.GetNewSession() if err != nil { return nil, fmt.Errorf("error connecting to db server: %v", err) } - // update masterSession based on flags + // update mainSession based on flags self.refresh() - // copy the provider's master session, for connection pooling - return self.masterSession.Copy(), nil + // copy the provider's main session, for connection pooling + return self.mainSession.Copy(), nil } -// Close closes the master session in the connection pool +// Close closes the main session in the connection pool func (self *SessionProvider) Close() { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() - if self.masterSession != nil { - self.masterSession.Close() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() + if self.mainSession != nil { + self.mainSession.Close() } } @@ -138,68 +138,68 @@ func (self *SessionProvider) Close() { // This helper assumes a lock is already taken. func (self *SessionProvider) refresh() { // handle bypassDocumentValidation - self.masterSession.SetBypassValidation(self.bypassDocumentValidation) + self.mainSession.SetBypassValidation(self.bypassDocumentValidation) // handle readPreference - self.masterSession.SetMode(self.readPreference, true) + self.mainSession.SetMode(self.readPreference, true) // disable timeouts if (self.flags & DisableSocketTimeout) > 0 { - self.masterSession.SetSocketTimeout(0) + self.mainSession.SetSocketTimeout(0) } if self.tags != nil { - self.masterSession.SelectServers(self.tags) + self.mainSession.SelectServers(self.tags) } } -// SetFlags allows certain modifications to the masterSession after initial creation. +// SetFlags allows certain modifications to the mainSession after initial creation. func (self *SessionProvider) SetFlags(flagBits sessionFlag) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() self.flags = flagBits - // make sure we update the master session if one already exists - if self.masterSession != nil { + // make sure we update the main session if one already exists + if self.mainSession != nil { self.refresh() } } // SetReadPreference sets the read preference mode in the SessionProvider -// and eventually in the masterSession +// and eventually in the mainSession func (self *SessionProvider) SetReadPreference(pref mgo.Mode) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() self.readPreference = pref - if self.masterSession != nil { + if self.mainSession != nil { self.refresh() } } // SetBypassDocumentValidation sets whether to bypass document validation in the SessionProvider -// and eventually in the masterSession +// and eventually in the mainSession func (self *SessionProvider) SetBypassDocumentValidation(bypassDocumentValidation bool) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() self.bypassDocumentValidation = bypassDocumentValidation - if self.masterSession != nil { + if self.mainSession != nil { self.refresh() } } // SetTags sets the server selection tags in the SessionProvider -// and eventually in the masterSession +// and eventually in the mainSession func (self *SessionProvider) SetTags(tags bson.D) { - self.masterSessionLock.Lock() - defer self.masterSessionLock.Unlock() + self.mainSessionLock.Lock() + defer self.mainSessionLock.Unlock() self.tags = tags - if self.masterSession != nil { + if self.mainSession != nil { self.refresh() } } @@ -244,7 +244,7 @@ func IsConnectionError(err error) bool { strings.Contains(lowerCaseError, ErrWriteResultsUnavailable) || strings.Contains(lowerCaseError, ErrCouldNotFindPrimaryPrefix) || strings.Contains(lowerCaseError, ErrUnableToTargetPrefix) || - lowerCaseError == ErrNotMaster || + lowerCaseError == ErrNotMain || strings.HasSuffix(lowerCaseError, ErrConnectionRefusedSuffix) { return true } diff --git a/src/normous/gotools/mongodump/oplog_dump.go b/src/normous/gotools/mongodump/oplog_dump.go index bcf8783cef..bbe6bb3d1e 100644 --- a/src/normous/gotools/mongodump/oplog_dump.go +++ b/src/normous/gotools/mongodump/oplog_dump.go @@ -18,23 +18,23 @@ import ( // determineOplogCollectionName uses a command to infer // the name of the oplog collection in the connected db func (dump *MongoDump) determineOplogCollectionName() error { - masterDoc := bson.M{} - err := dump.SessionProvider.Run("isMaster", &masterDoc, "admin") + mainDoc := bson.M{} + err := dump.SessionProvider.Run("isMain", &mainDoc, "admin") if err != nil { return fmt.Errorf("error running command: %v", err) } - if _, ok := masterDoc["hosts"]; ok { + if _, ok := mainDoc["hosts"]; ok { log.Logvf(log.DebugLow, "determined cluster to be a replica set") log.Logvf(log.DebugHigh, "oplog located in local.oplog.rs") dump.oplogCollection = "oplog.rs" return nil } - if isMaster := masterDoc["ismaster"]; util.IsFalsy(isMaster) { - log.Logvf(log.Info, "mongodump is not connected to a master") - return fmt.Errorf("not connected to master") + if isMain := mainDoc["ismain"]; util.IsFalsy(isMain) { + log.Logvf(log.Info, "mongodump is not connected to a main") + return fmt.Errorf("not connected to main") } - log.Logvf(log.DebugLow, "not connected to a replica set, assuming master/slave") + log.Logvf(log.DebugLow, "not connected to a replica set, assuming main/subordinate") log.Logvf(log.DebugHigh, "oplog located in local.oplog.$main") dump.oplogCollection = "oplog.$main" return nil diff --git a/src/normous/gotools/mongoexport/main/mongoexport.go b/src/normous/gotools/mongoexport/main/mongoexport.go index 69342cdd7b..96a08eda4b 100644 --- a/src/normous/gotools/mongoexport/main/mongoexport.go +++ b/src/normous/gotools/mongoexport/main/mongoexport.go @@ -82,12 +82,12 @@ func main() { provider.SetFlags(db.DisableSocketTimeout) - if inputOpts.SlaveOk { + if inputOpts.SubordinateOk { if inputOpts.ReadPreference != "" { - log.Logvf(log.Always, "--slaveOk can't be specified when --readPreference is specified") + log.Logvf(log.Always, "--subordinateOk can't be specified when --readPreference is specified") os.Exit(util.ExitBadOptions) } - log.Logvf(log.Always, "--slaveOk is deprecated and being internally rewritten as --readPreference=nearest") + log.Logvf(log.Always, "--subordinateOk is deprecated and being internally rewritten as --readPreference=nearest") inputOpts.ReadPreference = "nearest" } diff --git a/src/normous/gotools/mongoexport/options.go b/src/normous/gotools/mongoexport/options.go index cdc34b1264..ae469c92bb 100644 --- a/src/normous/gotools/mongoexport/options.go +++ b/src/normous/gotools/mongoexport/options.go @@ -53,7 +53,7 @@ func (*OutputFormatOptions) Name() string { type InputOptions struct { Query string `long:"query" value-name:"" short:"q" description:"query filter, as a JSON string, e.g., '{x:{$gt:1}}'"` QueryFile string `long:"queryFile" value-name:"" description:"path to a file containing a query filter (JSON)"` - SlaveOk bool `long:"slaveOk" short:"k" description:"allow secondary reads if available (default true)" default:"false" default-mask:"-"` + SubordinateOk bool `long:"subordinateOk" short:"k" description:"allow secondary reads if available (default true)" default:"false" default-mask:"-"` ReadPreference string `long:"readPreference" value-name:"|" description:"specify either a preference name or a preference json object"` ForceTableScan bool `long:"forceTableScan" description:"force a table scan (do not use $snapshot)"` Skip int `long:"skip" value-name:"" description:"number of documents to skip"` diff --git a/src/normous/gotools/mongoreplay/connection_stub.go b/src/normous/gotools/mongoreplay/connection_stub.go index 02bb1e5aaf..d04c53cb2f 100644 --- a/src/normous/gotools/mongoreplay/connection_stub.go +++ b/src/normous/gotools/mongoreplay/connection_stub.go @@ -89,7 +89,7 @@ func newTwoSidedConn() (conn1 ConnStub, conn2 ConnStub) { // AcquireSocketPrivate is an implementation of MongoSession's function that // allows for the a stubbed connection to the passed to the other operations of // llmgo for testing -func (session *SessionStub) AcquireSocketPrivate(slaveOk bool) (*mgo.MongoSocket, error) { +func (session *SessionStub) AcquireSocketPrivate(subordinateOk bool) (*mgo.MongoSocket, error) { session.startup.Do(func() { session.socket = mgo.NewDumbSocket(&session.connection) }) diff --git a/src/normous/gotools/mongoreplay/op.go b/src/normous/gotools/mongoreplay/op.go index e27319a9e8..058ebd717a 100644 --- a/src/normous/gotools/mongoreplay/op.go +++ b/src/normous/gotools/mongoreplay/op.go @@ -97,7 +97,7 @@ func (e ErrUnknownOpcode) Error() string { } // IsDriverOp checks if an operation is one of the types generated by the driver -// such as 'ismaster', or 'getnonce'. It takes an Op that has already been +// such as 'ismain', or 'getnonce'. It takes an Op that has already been // unmarshalled using its 'FromReader' method and checks if it is a command // matching the ones the driver generates. func IsDriverOp(op Op) bool { @@ -116,7 +116,7 @@ func IsDriverOp(op Op) bool { } switch commandType { - case "isMaster", "ismaster": + case "isMain", "ismain": return true case "getnonce": return true diff --git a/src/normous/gotools/mongoreplay/play_livedb_test.go b/src/normous/gotools/mongoreplay/play_livedb_test.go index e56a526a36..70ab5de511 100644 --- a/src/normous/gotools/mongoreplay/play_livedb_test.go +++ b/src/normous/gotools/mongoreplay/play_livedb_test.go @@ -87,7 +87,7 @@ func getPrimaryPort(session *mgo.Session) (string, error) { res := &struct { Msg string }{} - session.Run("ismaster", res) + session.Run("ismain", res) isMongosTestServer = (res.Msg == "isdbgrid") if isMongosTestServer { return "", nil diff --git a/src/normous/gotools/mongostat/status/server_status.go b/src/normous/gotools/mongostat/status/server_status.go index 76019710a7..f66d31b2c9 100644 --- a/src/normous/gotools/mongostat/status/server_status.go +++ b/src/normous/gotools/mongostat/status/server_status.go @@ -68,7 +68,7 @@ type TransactionStats struct { // ReplStatus stores data related to replica sets. type ReplStatus struct { SetName string `bson:"setName"` - IsMaster interface{} `bson:"ismaster"` + IsMain interface{} `bson:"ismain"` Secondary interface{} `bson:"secondary"` IsReplicaSet interface{} `bson:"isreplicaset"` ArbiterOnly interface{} `bson:"arbiterOnly"` diff --git a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/auth.go b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/auth.go index 9be48322e9..fd62858f42 100644 --- a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/auth.go +++ b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/auth.go @@ -73,7 +73,7 @@ type saslResult struct { } type saslMechNegotation struct { - IsMaster int `bson:"ismaster"` + IsMain int `bson:"ismain"` SaslSupportedMechs string `bson:"saslSupportedMechs"` } @@ -218,7 +218,7 @@ func (socket *MongoSocket) Login(cred Credential) error { func (socket *MongoSocket) negotiateDefaultMech(cred Credential) (string, error) { user := cred.Source + "." + cred.Username - req := &saslMechNegotation{IsMaster: 1, SaslSupportedMechs: user} + req := &saslMechNegotation{IsMain: 1, SaslSupportedMechs: user} res := saslMechResult{} err := socket.loginRun(cred.Source, &req, &res, func() error { if !res.Ok { diff --git a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/auth_test.go b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/auth_test.go index 2361e72803..ea55b71d36 100644 --- a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/auth_test.go +++ b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/auth_test.go @@ -793,7 +793,7 @@ func (s *S) TestDefaultDatabase(c *C) { } func (s *S) TestAuthDirect(c *C) { - // Direct connections must work to the master and slaves. + // Direct connections must work to the main and subordinates. for _, port := range []string{"40031", "40032", "40033"} { url := fmt.Sprintf("mongodb://root:rapadura@localhost:%s/?connect=direct", port) session, err := mgo.Dial(url) @@ -809,7 +809,7 @@ func (s *S) TestAuthDirect(c *C) { } func (s *S) TestAuthDirectWithLogin(c *C) { - // Direct connections must work to the master and slaves. + // Direct connections must work to the main and subordinates. for _, port := range []string{"40031", "40032", "40033"} { url := fmt.Sprintf("mongodb://localhost:%s/?connect=direct", port) session, err := mgo.Dial(url) diff --git a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/cluster.go b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/cluster.go index 56722e247c..b432db44e2 100644 --- a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/cluster.go +++ b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/cluster.go @@ -34,7 +34,7 @@ type mongoCluster struct { userSeeds []string dynaSeeds []string servers mongoServers - masters mongoServers + mains mongoServers references int syncing bool direct bool @@ -101,7 +101,7 @@ func (cluster *mongoCluster) LiveServers() (servers []string) { func (cluster *mongoCluster) removeServer(server *MongoServer) { cluster.Lock() - cluster.masters.Remove(server) + cluster.mains.Remove(server) other := cluster.servers.Remove(server) cluster.Unlock() if other != nil { @@ -111,8 +111,8 @@ func (cluster *mongoCluster) removeServer(server *MongoServer) { server.Close() } -type isMasterResult struct { - IsMaster bool +type isMainResult struct { + IsMain bool Secondary bool Primary string Hosts []string @@ -123,11 +123,11 @@ type isMasterResult struct { MaxWireVersion int `bson:"maxWireVersion"` } -func (cluster *mongoCluster) isMaster(socket *MongoSocket, result *isMasterResult) error { - // Monotonic let's it talk to a slave and still hold the socket. +func (cluster *mongoCluster) isMain(socket *MongoSocket, result *isMainResult) error { + // Monotonic let's it talk to a subordinate and still hold the socket. session := newSession(Monotonic, cluster, 10*time.Second) session.setSocket(socket) - err := session.Run("ismaster", result) + err := session.Run("ismain", result) session.Close() return err } @@ -153,7 +153,7 @@ func (cluster *mongoCluster) syncServer(server *MongoServer) (info *mongoServerI log("SYNC Processing ", addr, "...") // Retry a few times to avoid knocking a server down for a hiccup. - var result isMasterResult + var result isMainResult var tryerr error for retry := 0; ; retry++ { if retry == 3 || retry == 1 && cluster.failFast { @@ -176,14 +176,14 @@ func (cluster *mongoCluster) syncServer(server *MongoServer) (info *mongoServerI logf("SYNC Failed to get socket to %s: %v", addr, err) continue } - err = cluster.isMaster(socket, &result) + err = cluster.isMain(socket, &result) socket.Release() if err != nil { tryerr = err - logf("SYNC Command 'ismaster' to %s failed: %v", addr, err) + logf("SYNC Command 'ismain' to %s failed: %v", addr, err) continue } - debugf("SYNC Result of 'ismaster' from %s: %#v", addr, result) + debugf("SYNC Result of 'ismain' from %s: %#v", addr, result) break } @@ -192,25 +192,25 @@ func (cluster *mongoCluster) syncServer(server *MongoServer) (info *mongoServerI return nil, nil, fmt.Errorf("server %s is not a member of replica set %q", addr, cluster.setName) } - if result.IsMaster { - debugf("SYNC %s is a master.", addr) - if !server.info.Master { + if result.IsMain { + debugf("SYNC %s is a main.", addr) + if !server.info.Main { // Made an incorrect assumption above, so fix stats. stats.conn(-1, false) stats.conn(+1, true) } } else if result.Secondary { - debugf("SYNC %s is a slave.", addr) + debugf("SYNC %s is a subordinate.", addr) } else if cluster.direct { - logf("SYNC %s in unknown state. Pretending it's a slave due to direct connection.", addr) + logf("SYNC %s in unknown state. Pretending it's a subordinate due to direct connection.", addr) } else { - logf("SYNC %s is neither a master nor a slave.", addr) + logf("SYNC %s is neither a main nor a subordinate.", addr) // Let stats track it as whatever was known before. - return nil, nil, errors.New(addr + " is not a master nor slave") + return nil, nil, errors.New(addr + " is not a main nor subordinate") } info = &mongoServerInfo{ - Master: result.IsMaster, + Main: result.IsMain, Mongos: result.Msg == "isdbgrid", Tags: result.Tags, SetName: result.SetName, @@ -219,7 +219,7 @@ func (cluster *mongoCluster) syncServer(server *MongoServer) (info *mongoServerI hosts = make([]string, 0, 1+len(result.Hosts)+len(result.Passives)) if result.Primary != "" { - // First in the list to speed up master discovery. + // First in the list to speed up main discovery. hosts = append(hosts, result.Primary) } hosts = append(hosts, result.Hosts...) @@ -247,23 +247,23 @@ func (cluster *mongoCluster) addServer(server *MongoServer, info *mongoServerInf return } cluster.servers.Add(server) - if info.Master { - cluster.masters.Add(server) - log("SYNC Adding ", server.Addr, " to cluster as a master.") + if info.Main { + cluster.mains.Add(server) + log("SYNC Adding ", server.Addr, " to cluster as a main.") } else { - log("SYNC Adding ", server.Addr, " to cluster as a slave.") + log("SYNC Adding ", server.Addr, " to cluster as a subordinate.") } } else { if server != current { panic("addServer attempting to add duplicated server") } - if server.Info().Master != info.Master { - if info.Master { - log("SYNC Server ", server.Addr, " is now a master.") - cluster.masters.Add(server) + if server.Info().Main != info.Main { + if info.Main { + log("SYNC Server ", server.Addr, " is now a main.") + cluster.mains.Add(server) } else { - log("SYNC Server ", server.Addr, " is now a slave.") - cluster.masters.Remove(server) + log("SYNC Server ", server.Addr, " is now a subordinate.") + cluster.mains.Remove(server) } } } @@ -361,11 +361,11 @@ func (cluster *mongoCluster) syncServersLoop() { // restart syncing if they wish to. cluster.serverSynced.Broadcast() // Check if we have to restart immediately either way. - restart := !direct && cluster.masters.Empty() || cluster.servers.Empty() + restart := !direct && cluster.mains.Empty() || cluster.servers.Empty() cluster.Unlock() if restart { - log("SYNC No masters found. Will synchronize again.") + log("SYNC No mains found. Will synchronize again.") time.Sleep(syncShortDelay) continue } @@ -467,8 +467,8 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { seen := make(map[string]bool) syncKind := partialSync - var spawnSync func(addr string, byMaster bool) - spawnSync = func(addr string, byMaster bool) { + var spawnSync func(addr string, byMain bool) + spawnSync = func(addr string, byMain bool) { wg.Add(1) go func() { defer wg.Done() @@ -481,7 +481,7 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { resolvedAddr := tcpaddr.String() m.Lock() - if byMaster { + if byMain { if pending, ok := notYetAdded[resolvedAddr]; ok { delete(notYetAdded, resolvedAddr) m.Unlock() @@ -505,7 +505,7 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { } m.Lock() - add := direct || info.Master || addIfFound[resolvedAddr] + add := direct || info.Main || addIfFound[resolvedAddr] if add { syncKind = completeSync } else { @@ -517,7 +517,7 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { } if !direct { for _, addr := range hosts { - spawnSync(addr, info.Master) + spawnSync(addr, info.Main) } } }() @@ -542,8 +542,8 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { } cluster.Lock() - mastersLen := cluster.masters.Len() - logf("SYNC Synchronization completed: %d master(s) and %d slave(s) alive.", mastersLen, cluster.servers.Len()-mastersLen) + mainsLen := cluster.mains.Len() + logf("SYNC Synchronization completed: %d main(s) and %d subordinate(s) alive.", mainsLen, cluster.servers.Len()-mainsLen) // Update dynamic seeds, but only if we have any good servers. Otherwise, // leave them alone for better chances of a successful sync in the future. @@ -558,20 +558,20 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { cluster.Unlock() } -// AcquireSocket returns a socket to a server in the cluster. If slaveOk is -// true, it will attempt to return a socket to a slave server. If it is -// false, the socket will necessarily be to a master server. -func (cluster *mongoCluster) AcquireSocket(mode Mode, slaveOk bool, syncTimeout time.Duration, socketTimeout time.Duration, serverTags []bson.D, poolLimit int) (s *MongoSocket, err error) { +// AcquireSocket returns a socket to a server in the cluster. If subordinateOk is +// true, it will attempt to return a socket to a subordinate server. If it is +// false, the socket will necessarily be to a main server. +func (cluster *mongoCluster) AcquireSocket(mode Mode, subordinateOk bool, syncTimeout time.Duration, socketTimeout time.Duration, serverTags []bson.D, poolLimit int) (s *MongoSocket, err error) { var started time.Time var syncCount uint warnedLimit := false for { cluster.RLock() for { - mastersLen := cluster.masters.Len() - slavesLen := cluster.servers.Len() - mastersLen - debugf("Cluster has %d known masters and %d known slaves.", mastersLen, slavesLen) - if !(slaveOk && mode == Secondary) && mastersLen > 0 || slaveOk && slavesLen > 0 { + mainsLen := cluster.mains.Len() + subordinatesLen := cluster.servers.Len() - mainsLen + debugf("Cluster has %d known mains and %d known subordinates.", mainsLen, subordinatesLen) + if !(subordinateOk && mode == Secondary) && mainsLen > 0 || subordinateOk && subordinatesLen > 0 { break } if started.IsZero() { @@ -590,10 +590,10 @@ func (cluster *mongoCluster) AcquireSocket(mode Mode, slaveOk bool, syncTimeout } var server *MongoServer - if slaveOk { + if subordinateOk { server = cluster.servers.BestFit(mode, serverTags) } else { - server = cluster.masters.BestFit(mode, nil) + server = cluster.mains.BestFit(mode, nil) } cluster.RUnlock() @@ -617,11 +617,11 @@ func (cluster *mongoCluster) AcquireSocket(mode Mode, slaveOk bool, syncTimeout cluster.syncServers() continue } - if abended && !slaveOk { - var result isMasterResult - err := cluster.isMaster(s, &result) - if err != nil || !result.IsMaster { - logf("Cannot confirm server %s as master (%v)", server.Addr, err) + if abended && !subordinateOk { + var result isMainResult + err := cluster.isMain(s, &result) + if err != nil || !result.IsMain { + logf("Cannot confirm server %s as main (%v)", server.Addr, err) s.Release() cluster.syncServers() time.Sleep(100 * time.Millisecond) diff --git a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/cluster_test.go b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/cluster_test.go index 791d96864a..e40d2ebfe0 100644 --- a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/cluster_test.go +++ b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/cluster_test.go @@ -50,7 +50,7 @@ func (s *S) TestNewSession(c *C) { // With New(), each session has its own socket now. stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 2) c.Assert(stats.SocketsInUse, Equals, 2) // Ensure query parameters were cloned. @@ -153,9 +153,9 @@ func (s *S) TestModeStrong(c *C) { result := M{} cmd := session.DB("admin").C("$cmd") - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, true) + c.Assert(result["ismain"], Equals, true) coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) @@ -168,8 +168,8 @@ func (s *S) TestModeStrong(c *C) { } stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 2) c.Assert(stats.SocketsInUse, Equals, 1) session.SetMode(mgo.Strong, true) @@ -179,8 +179,8 @@ func (s *S) TestModeStrong(c *C) { } func (s *S) TestModeMonotonic(c *C) { - // Must necessarily connect to a slave, otherwise the - // master connection will be available first. + // Must necessarily connect to a subordinate, otherwise the + // main connection will be available first. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() @@ -189,19 +189,19 @@ func (s *S) TestModeMonotonic(c *C) { c.Assert(session.Mode(), Equals, mgo.Monotonic) - var result struct{ IsMaster bool } + var result struct{ IsMain bool } cmd := session.DB("admin").C("$cmd") - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result.IsMaster, Equals, false) + c.Assert(result.IsMain, Equals, false) coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result.IsMaster, Equals, true) + c.Assert(result.IsMain, Equals, true) // Wait since the sync also uses sockets. for len(session.LiveServers()) != 3 { @@ -210,8 +210,8 @@ func (s *S) TestModeMonotonic(c *C) { } stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 2) c.Assert(stats.SocketsInUse, Equals, 2) session.SetMode(mgo.Monotonic, true) @@ -228,7 +228,7 @@ func (s *S) TestModeMonotonicAfterStrong(c *C) { c.Assert(err, IsNil) defer session.Close() - // Insert something to force a connection to the master. + // Insert something to force a connection to the main. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) @@ -241,37 +241,37 @@ func (s *S) TestModeMonotonicAfterStrong(c *C) { time.Sleep(5e8) } - // Master socket should still be reserved. + // Main socket should still be reserved. stats := mgo.GetStats() c.Assert(stats.SocketsInUse, Equals, 1) - // Confirm it's the master even though it's Monotonic by now. + // Confirm it's the main even though it's Monotonic by now. result := M{} cmd := session.DB("admin").C("$cmd") - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, true) + c.Assert(result["ismain"], Equals, true) } func (s *S) TestModeStrongAfterMonotonic(c *C) { // Test that shifting from Monotonic to Strong while - // using a slave socket will keep the socket reserved - // until the master socket is necessary, so that no + // using a subordinate socket will keep the socket reserved + // until the main socket is necessary, so that no // switch over occurs unless it's actually necessary. - // Must necessarily connect to a slave, otherwise the - // master connection will be available first. + // Must necessarily connect to a subordinate, otherwise the + // main connection will be available first. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() session.SetMode(mgo.Monotonic, false) - // Ensure we're talking to a slave, and reserve the socket. + // Ensure we're talking to a subordinate, and reserve the socket. result := M{} - err = session.Run("ismaster", &result) + err = session.Run("ismain", &result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, false) + c.Assert(result["ismain"], Equals, false) // Switch to a Strong session. session.SetMode(mgo.Strong, false) @@ -282,20 +282,20 @@ func (s *S) TestModeStrongAfterMonotonic(c *C) { time.Sleep(5e8) } - // Slave socket should still be reserved. + // Subordinate socket should still be reserved. stats := mgo.GetStats() c.Assert(stats.SocketsInUse, Equals, 1) - // But any operation will switch it to the master. + // But any operation will switch it to the main. result = M{} - err = session.Run("ismaster", &result) + err = session.Run("ismain", &result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, true) + c.Assert(result["ismain"], Equals, true) } func (s *S) TestModeMonotonicWriteOnIteration(c *C) { - // Must necessarily connect to a slave, otherwise the - // master connection will be available first. + // Must necessarily connect to a subordinate, otherwise the + // main connection will be available first. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() @@ -313,7 +313,7 @@ func (s *S) TestModeMonotonicWriteOnIteration(c *C) { c.Assert(err, IsNil) } - // Release master so we can grab a slave again. + // Release main so we can grab a subordinate again. session.Refresh() // Wait until synchronization is done. @@ -339,8 +339,8 @@ func (s *S) TestModeMonotonicWriteOnIteration(c *C) { } func (s *S) TestModeEventual(c *C) { - // Must necessarily connect to a slave, otherwise the - // master connection will be available first. + // Must necessarily connect to a subordinate, otherwise the + // main connection will be available first. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() @@ -350,18 +350,18 @@ func (s *S) TestModeEventual(c *C) { c.Assert(session.Mode(), Equals, mgo.Eventual) result := M{} - err = session.Run("ismaster", &result) + err = session.Run("ismain", &result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, false) + c.Assert(result["ismain"], Equals, false) coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) result = M{} - err = session.Run("ismaster", &result) + err = session.Run("ismain", &result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, false) + c.Assert(result["ismain"], Equals, false) // Wait since the sync also uses sockets. for len(session.LiveServers()) != 3 { @@ -370,8 +370,8 @@ func (s *S) TestModeEventual(c *C) { } stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 2) c.Assert(stats.SocketsInUse, Equals, 0) } @@ -383,7 +383,7 @@ func (s *S) TestModeEventualAfterStrong(c *C) { c.Assert(err, IsNil) defer session.Close() - // Insert something to force a connection to the master. + // Insert something to force a connection to the main. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) @@ -396,16 +396,16 @@ func (s *S) TestModeEventualAfterStrong(c *C) { time.Sleep(5e8) } - // Master socket should still be reserved. + // Main socket should still be reserved. stats := mgo.GetStats() c.Assert(stats.SocketsInUse, Equals, 1) - // Confirm it's the master even though it's Eventual by now. + // Confirm it's the main even though it's Eventual by now. result := M{} cmd := session.DB("admin").C("$cmd") - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, true) + c.Assert(result["ismain"], Equals, true) session.SetMode(mgo.Eventual, true) @@ -422,12 +422,12 @@ func (s *S) TestModeStrongFallover(c *C) { c.Assert(err, IsNil) defer session.Close() - // With strong consistency, this will open a socket to the master. + // With strong consistency, this will open a socket to the main. result := &struct{ Host string }{} err = session.Run("serverStatus", result) c.Assert(err, IsNil) - // Kill the master. + // Kill the main. host := result.Host s.Stop(host) @@ -441,7 +441,7 @@ func (s *S) TestModeStrongFallover(c *C) { session.Refresh() - // Now we should be able to talk to the new master. + // Now we should be able to talk to the new main. // Increase the timeout since this may take quite a while. session.SetSyncTimeout(3 * time.Minute) @@ -449,7 +449,7 @@ func (s *S) TestModeStrongFallover(c *C) { c.Assert(err, IsNil) c.Assert(result.Host, Not(Equals), host) - // Insert some data to confirm it's indeed a master. + // Insert some data to confirm it's indeed a main. err = session.DB("mydb").C("mycoll").Insert(M{"n": 42}) c.Assert(err, IsNil) } @@ -463,13 +463,13 @@ func (s *S) TestModePrimaryHiccup(c *C) { c.Assert(err, IsNil) defer session.Close() - // With strong consistency, this will open a socket to the master. + // With strong consistency, this will open a socket to the main. result := &struct{ Host string }{} err = session.Run("serverStatus", result) c.Assert(err, IsNil) // Establish a few extra sessions to create spare sockets to - // the master. This increases a bit the chances of getting an + // the main. This increases a bit the chances of getting an // incorrect cached socket. var sessions []*mgo.Session for i := 0; i < 20; i++ { @@ -481,7 +481,7 @@ func (s *S) TestModePrimaryHiccup(c *C) { sessions[i].Close() } - // Kill the master, but bring it back immediatelly. + // Kill the main, but bring it back immediatelly. host := result.Host s.Stop(host) s.StartAll() @@ -496,11 +496,11 @@ func (s *S) TestModePrimaryHiccup(c *C) { session.Refresh() - // Now we should be able to talk to the new master. + // Now we should be able to talk to the new main. // Increase the timeout since this may take quite a while. session.SetSyncTimeout(3 * time.Minute) - // Insert some data to confirm it's indeed a master. + // Insert some data to confirm it's indeed a main. err = session.DB("mydb").C("mycoll").Insert(M{"n": 42}) c.Assert(err, IsNil) } @@ -516,19 +516,19 @@ func (s *S) TestModeMonotonicFallover(c *C) { session.SetMode(mgo.Monotonic, true) - // Insert something to force a switch to the master. + // Insert something to force a switch to the main. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - // Wait a bit for this to be synchronized to slaves. + // Wait a bit for this to be synchronized to subordinates. time.Sleep(3 * time.Second) result := &struct{ Host string }{} err = session.Run("serverStatus", result) c.Assert(err, IsNil) - // Kill the master. + // Kill the main. host := result.Host s.Stop(host) @@ -542,13 +542,13 @@ func (s *S) TestModeMonotonicFallover(c *C) { session.Refresh() - // Now we should be able to talk to the new master. + // Now we should be able to talk to the new main. err = session.Run("serverStatus", result) c.Assert(err, IsNil) c.Assert(result.Host, Not(Equals), host) } -func (s *S) TestModeMonotonicWithSlaveFallover(c *C) { +func (s *S) TestModeMonotonicWithSubordinateFallover(c *C) { if *fast { c.Skip("-fast") } @@ -558,19 +558,19 @@ func (s *S) TestModeMonotonicWithSlaveFallover(c *C) { defer session.Close() ssresult := &struct{ Host string }{} - imresult := &struct{ IsMaster bool }{} + imresult := &struct{ IsMain bool }{} - // Figure the master while still using the strong session. + // Figure the main while still using the strong session. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - master := ssresult.Host - c.Assert(imresult.IsMaster, Equals, true, Commentf("%s is not the master", master)) + main := ssresult.Host + c.Assert(imresult.IsMain, Equals, true, Commentf("%s is not the main", main)) // Create new monotonic session with an explicit address to ensure - // a slave is synchronized before the master, otherwise a connection - // with the master may be used below for lack of other options. + // a subordinate is synchronized before the main, otherwise a connection + // with the main may be used below for lack of other options. var addr string switch { case strings.HasSuffix(ssresult.Host, ":40021"): @@ -590,41 +590,41 @@ func (s *S) TestModeMonotonicWithSlaveFallover(c *C) { session.SetMode(mgo.Monotonic, true) // Check the address of the socket associated with the monotonic session. - c.Log("Running serverStatus and isMaster with monotonic session") + c.Log("Running serverStatus and isMain with monotonic session") err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - slave := ssresult.Host - c.Assert(imresult.IsMaster, Equals, false, Commentf("%s is not a slave", slave)) + subordinate := ssresult.Host + c.Assert(imresult.IsMain, Equals, false, Commentf("%s is not a subordinate", subordinate)) - c.Assert(master, Not(Equals), slave) + c.Assert(main, Not(Equals), subordinate) - // Kill the master. - s.Stop(master) + // Kill the main. + s.Stop(main) - // Session must still be good, since we were talking to a slave. + // Session must still be good, since we were talking to a subordinate. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - c.Assert(ssresult.Host, Equals, slave, - Commentf("Monotonic session moved from %s to %s", slave, ssresult.Host)) + c.Assert(ssresult.Host, Equals, subordinate, + Commentf("Monotonic session moved from %s to %s", subordinate, ssresult.Host)) // If we try to insert something, it'll have to hold until the new - // master is available to move the connection, and work correctly. + // main is available to move the connection, and work correctly. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - // Must now be talking to the new master. + // Must now be talking to the new main. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - c.Assert(imresult.IsMaster, Equals, true, Commentf("%s is not the master", master)) + c.Assert(imresult.IsMain, Equals, true, Commentf("%s is not the main", main)) // ... which is not the old one, since it's still dead. - c.Assert(ssresult.Host, Not(Equals), master) + c.Assert(ssresult.Host, Not(Equals), main) } func (s *S) TestModeEventualFallover(c *C) { @@ -639,29 +639,29 @@ func (s *S) TestModeEventualFallover(c *C) { result := &struct{ Host string }{} err = session.Run("serverStatus", result) c.Assert(err, IsNil) - master := result.Host + main := result.Host session.SetMode(mgo.Eventual, true) - // Should connect to the master when needed. + // Should connect to the main when needed. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - // Wait a bit for this to be synchronized to slaves. + // Wait a bit for this to be synchronized to subordinates. time.Sleep(3 * time.Second) - // Kill the master. - s.Stop(master) + // Kill the main. + s.Stop(main) - // Should still work, with the new master now. + // Should still work, with the new main now. coll = session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) err = session.Run("serverStatus", result) c.Assert(err, IsNil) - c.Assert(result.Host, Not(Equals), master) + c.Assert(result.Host, Not(Equals), main) } func (s *S) TestModeSecondaryJustPrimary(c *C) { @@ -723,7 +723,7 @@ func (s *S) TestModeSecondaryPreferredFallover(c *C) { err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - // Wait a bit for this to be synchronized to slaves. + // Wait a bit for this to be synchronized to subordinates. time.Sleep(3 * time.Second) // Kill the primary. @@ -868,7 +868,7 @@ func (s *S) TestPreserveSocketCountOnSync(c *C) { c.Assert(stats.SocketsAlive, Equals, 3) - // Kill the master (with rs1, 'a' is always the master). + // Kill the main (with rs1, 'a' is always the main). s.Stop("localhost:40011") // Wait for the logic to run for a bit and bring it back. @@ -907,10 +907,10 @@ func (s *S) TestPreserveSocketCountOnSync(c *C) { c.Assert(stats.SocketRefs, Equals, 1) } -// Connect to the master of a deployment with a single server, +// Connect to the main of a deployment with a single server, // run an insert, and then ensure the insert worked and that a // single connection was established. -func (s *S) TestTopologySyncWithSingleMaster(c *C) { +func (s *S) TestTopologySyncWithSingleMain(c *C) { // Use hostname here rather than IP, to make things trickier. session, err := mgo.Dial("localhost:40001") c.Assert(err, IsNil) @@ -920,11 +920,11 @@ func (s *S) TestTopologySyncWithSingleMaster(c *C) { err = coll.Insert(M{"a": 1, "b": 2}) c.Assert(err, IsNil) - // One connection used for discovery. Master socket recycled for + // One connection used for discovery. Main socket recycled for // insert. Socket is reserved after insert. stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 0) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 0) c.Assert(stats.SocketsInUse, Equals, 1) // Refresh session and socket must be released. @@ -933,9 +933,9 @@ func (s *S) TestTopologySyncWithSingleMaster(c *C) { c.Assert(stats.SocketsInUse, Equals, 0) } -func (s *S) TestTopologySyncWithSlaveSeed(c *C) { - // That's supposed to be a slave. Must run discovery - // and find out master to insert successfully. +func (s *S) TestTopologySyncWithSubordinateSeed(c *C) { + // That's supposed to be a subordinate. Must run discovery + // and find out main to insert successfully. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() @@ -948,13 +948,13 @@ func (s *S) TestTopologySyncWithSlaveSeed(c *C) { c.Assert(err, IsNil) c.Assert(result.Ok, Equals, true) - // One connection to each during discovery. Master + // One connection to each during discovery. Main // socket recycled for insert. stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 2) - // Only one socket reference alive, in the master socket owned + // Only one socket reference alive, in the main socket owned // by the above session. c.Assert(stats.SocketsInUse, Equals, 1) @@ -1143,7 +1143,7 @@ func (s *S) TestDirect(c *C) { c.Assert(err, IsNil) defer session.Close() - // We know that server is a slave. + // We know that server is a subordinate. session.SetMode(mgo.Monotonic, true) result := &struct{ Host string }{} @@ -1156,7 +1156,7 @@ func (s *S) TestDirect(c *C) { c.Assert(stats.SocketsInUse, Equals, 1) c.Assert(stats.SocketRefs, Equals, 1) - // We've got no master, so it'll timeout. + // We've got no main, so it'll timeout. session.SetSyncTimeout(5e8 * time.Nanosecond) coll := session.DB("mydb").C("mycoll") @@ -1194,14 +1194,14 @@ func (s *S) TestDirectToUnknownStateMember(c *C) { c.Assert(err, IsNil) c.Assert(strings.HasSuffix(result.Host, ":40041"), Equals, true) - // We've got no master, so it'll timeout. + // We've got no main, so it'll timeout. session.SetSyncTimeout(5e8 * time.Nanosecond) coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"test": 1}) c.Assert(err, ErrorMatches, "no reachable servers") - // Slave is still reachable. + // Subordinate is still reachable. result.Host = "" err = session.Run("serverStatus", result) c.Assert(err, IsNil) @@ -1245,21 +1245,21 @@ func (s *S) countQueries(c *C, server string) (n int) { return result.OpCounters.Query } -func (s *S) TestMonotonicSlaveOkFlagWithMongos(c *C) { +func (s *S) TestMonotonicSubordinateOkFlagWithMongos(c *C) { session, err := mgo.Dial("localhost:40021") c.Assert(err, IsNil) defer session.Close() ssresult := &struct{ Host string }{} - imresult := &struct{ IsMaster bool }{} + imresult := &struct{ IsMain bool }{} - // Figure the master while still using the strong session. + // Figure the main while still using the strong session. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - master := ssresult.Host - c.Assert(imresult.IsMaster, Equals, true, Commentf("%s is not the master", master)) + main := ssresult.Host + c.Assert(imresult.IsMain, Equals, true, Commentf("%s is not the main", main)) // Ensure mongos is aware about the current topology. s.Stop(":40201") @@ -1297,7 +1297,7 @@ func (s *S) TestMonotonicSlaveOkFlagWithMongos(c *C) { q22a := s.countQueries(c, "localhost:40022") q23a := s.countQueries(c, "localhost:40023") - // Do a SlaveOk query through MongoS + // Do a SubordinateOk query through MongoS mongos.SetMode(mgo.Monotonic, true) @@ -1314,23 +1314,23 @@ func (s *S) TestMonotonicSlaveOkFlagWithMongos(c *C) { q22b := s.countQueries(c, "localhost:40022") q23b := s.countQueries(c, "localhost:40023") - var masterDelta, slaveDelta int - switch hostPort(master) { + var mainDelta, subordinateDelta int + switch hostPort(main) { case "40021": - masterDelta = q21b - q21a - slaveDelta = (q22b - q22a) + (q23b - q23a) + mainDelta = q21b - q21a + subordinateDelta = (q22b - q22a) + (q23b - q23a) case "40022": - masterDelta = q22b - q22a - slaveDelta = (q21b - q21a) + (q23b - q23a) + mainDelta = q22b - q22a + subordinateDelta = (q21b - q21a) + (q23b - q23a) case "40023": - masterDelta = q23b - q23a - slaveDelta = (q21b - q21a) + (q22b - q22a) + mainDelta = q23b - q23a + subordinateDelta = (q21b - q21a) + (q22b - q22a) default: c.Fatal("Uh?") } - c.Check(masterDelta, Equals, 0) // Just the counting itself. - c.Check(slaveDelta, Equals, 5) // The counting for both, plus 5 queries above. + c.Check(mainDelta, Equals, 0) // Just the counting itself. + c.Check(subordinateDelta, Equals, 5) // The counting for both, plus 5 queries above. } func (s *S) TestRemovalOfClusterMember(c *C) { @@ -1338,31 +1338,31 @@ func (s *S) TestRemovalOfClusterMember(c *C) { c.Skip("-fast") } - master, err := mgo.Dial("localhost:40021") + main, err := mgo.Dial("localhost:40021") c.Assert(err, IsNil) - defer master.Close() + defer main.Close() // Wait for cluster to fully sync up. for i := 0; i < 10; i++ { - if len(master.LiveServers()) == 3 { + if len(main.LiveServers()) == 3 { break } time.Sleep(5e8) } - if len(master.LiveServers()) != 3 { - c.Fatalf("Test started with bad cluster state: %v", master.LiveServers()) + if len(main.LiveServers()) != 3 { + c.Fatalf("Test started with bad cluster state: %v", main.LiveServers()) } result := &struct { - IsMaster bool + IsMain bool Me string }{} - slave := master.Copy() - slave.SetMode(mgo.Monotonic, true) // Monotonic can hold a non-master socket persistently. - err = slave.Run("isMaster", result) + subordinate := main.Copy() + subordinate.SetMode(mgo.Monotonic, true) // Monotonic can hold a non-main socket persistently. + err = subordinate.Run("isMain", result) c.Assert(err, IsNil) - c.Assert(result.IsMaster, Equals, false) - slaveAddr := result.Me + c.Assert(result.IsMain, Equals, false) + subordinateAddr := result.Me defer func() { config := map[string]string{ @@ -1370,10 +1370,10 @@ func (s *S) TestRemovalOfClusterMember(c *C) { "40022": `{_id: 2, host: "127.0.0.1:40022", priority: 0, tags: {rs2: "b"}}`, "40023": `{_id: 3, host: "127.0.0.1:40023", priority: 0, tags: {rs2: "c"}}`, } - master.Refresh() - master.Run(bson.D{{"$eval", `rs.add(` + config[hostPort(slaveAddr)] + `)`}}, nil) - master.Close() - slave.Close() + main.Refresh() + main.Run(bson.D{{"$eval", `rs.add(` + config[hostPort(subordinateAddr)] + `)`}}, nil) + main.Close() + subordinate.Close() // Ensure suite syncs up with the changes before next test. s.Stop(":40201") @@ -1384,29 +1384,29 @@ func (s *S) TestRemovalOfClusterMember(c *C) { // break due to their expectation of things being in a working state. }() - c.Logf("========== Removing slave: %s ==========", slaveAddr) + c.Logf("========== Removing subordinate: %s ==========", subordinateAddr) - master.Run(bson.D{{"$eval", `rs.remove("` + slaveAddr + `")`}}, nil) + main.Run(bson.D{{"$eval", `rs.remove("` + subordinateAddr + `")`}}, nil) - master.Refresh() + main.Refresh() - // Give the cluster a moment to catch up by doing a roundtrip to the master. - err = master.Ping() + // Give the cluster a moment to catch up by doing a roundtrip to the main. + err = main.Ping() c.Assert(err, IsNil) time.Sleep(3e9) - // This must fail since the slave has been taken off the cluster. - err = slave.Ping() + // This must fail since the subordinate has been taken off the cluster. + err = subordinate.Ping() c.Assert(err, NotNil) for i := 0; i < 15; i++ { - if len(master.LiveServers()) == 2 { + if len(main.LiveServers()) == 2 { break } time.Sleep(time.Second) } - live := master.LiveServers() + live := main.LiveServers() if len(live) != 2 { c.Errorf("Removed server still considered live: %#s", live) } @@ -1470,23 +1470,23 @@ func (s *S) TestPoolLimitMany(c *C) { const poolLimit = 64 session.SetPoolLimit(poolLimit) - // Consume the whole limit for the master. - var master []*mgo.Session + // Consume the whole limit for the main. + var main []*mgo.Session for i := 0; i < poolLimit; i++ { s := session.Copy() defer s.Close() c.Assert(s.Ping(), IsNil) - master = append(master, s) + main = append(main, s) } before := time.Now() go func() { time.Sleep(3e9) - master[0].Refresh() + main[0].Refresh() }() // Then, a single ping must block, since it would need another - // connection to the master, over the limit. Once the goroutine + // connection to the main, over the limit. Once the goroutine // above releases its socket, it should move on. session.Ping() delay := time.Now().Sub(before) @@ -1622,17 +1622,17 @@ func (s *S) TestPrimaryShutdownOnAuthShard(c *C) { err = coll.Insert(bson.M{"n": 1}) c.Assert(err, IsNil) - // Dial the replica set to figure the master out. + // Dial the replica set to figure the main out. rs, err := mgo.Dial("root:rapadura@localhost:40031") c.Assert(err, IsNil) defer rs.Close() - // With strong consistency, this will open a socket to the master. + // With strong consistency, this will open a socket to the main. result := &struct{ Host string }{} err = rs.Run("serverStatus", result) c.Assert(err, IsNil) - // Kill the master. + // Kill the main. host := result.Host s.Stop(host) @@ -1640,7 +1640,7 @@ func (s *S) TestPrimaryShutdownOnAuthShard(c *C) { err = rs.Run("serverStatus", result) c.Assert(err, Equals, io.EOF) - // This won't work because the master just died. + // This won't work because the main just died. err = coll.Insert(bson.M{"n": 2}) c.Assert(err, NotNil) @@ -1651,7 +1651,7 @@ func (s *S) TestPrimaryShutdownOnAuthShard(c *C) { if err == nil { break } - c.Logf("Waiting for replica set to elect a new master. Last error: %v", err) + c.Logf("Waiting for replica set to elect a new main. Last error: %v", err) time.Sleep(500 * time.Millisecond) } c.Assert(err, IsNil) @@ -1693,7 +1693,7 @@ func (s *S) TestNearestSecondary(c *C) { session.SetMode(mgo.Monotonic, true) var result struct{ Host string } - // See which slave picks the line, several times to avoid chance. + // See which subordinate picks the line, several times to avoid chance. for i := 0; i < 10; i++ { session.Refresh() err = session.Run("serverStatus", &result) @@ -1841,24 +1841,24 @@ func (s *S) TestSelectServersWithMongos(c *C) { defer session.Close() ssresult := &struct{ Host string }{} - imresult := &struct{ IsMaster bool }{} + imresult := &struct{ IsMain bool }{} - // Figure the master while still using the strong session. + // Figure the main while still using the strong session. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - master := ssresult.Host - c.Assert(imresult.IsMaster, Equals, true, Commentf("%s is not the master", master)) + main := ssresult.Host + c.Assert(imresult.IsMain, Equals, true, Commentf("%s is not the main", main)) - var slave1, slave2 string - switch hostPort(master) { + var subordinate1, subordinate2 string + switch hostPort(main) { case "40021": - slave1, slave2 = "b", "c" + subordinate1, subordinate2 = "b", "c" case "40022": - slave1, slave2 = "a", "c" + subordinate1, subordinate2 = "a", "c" case "40023": - slave1, slave2 = "a", "b" + subordinate1, subordinate2 = "a", "b" } // Collect op counters for everyone. @@ -1866,7 +1866,7 @@ func (s *S) TestSelectServersWithMongos(c *C) { q22a := s.countQueries(c, "localhost:40022") q23a := s.countQueries(c, "localhost:40023") - // Do a SlaveOk query through MongoS + // Do a SubordinateOk query through MongoS mongos, err := mgo.Dial("localhost:40202") c.Assert(err, IsNil) defer mongos.Close() @@ -1874,7 +1874,7 @@ func (s *S) TestSelectServersWithMongos(c *C) { mongos.SetMode(mgo.Monotonic, true) mongos.Refresh() - mongos.SelectServers(bson.D{{"rs2", slave1}}) + mongos.SelectServers(bson.D{{"rs2", subordinate1}}) coll := mongos.DB("mydb").C("mycoll") result := &struct{}{} for i := 0; i != 5; i++ { @@ -1883,7 +1883,7 @@ func (s *S) TestSelectServersWithMongos(c *C) { } mongos.Refresh() - mongos.SelectServers(bson.D{{"rs2", slave2}}) + mongos.SelectServers(bson.D{{"rs2", subordinate2}}) coll = mongos.DB("mydb").C("mycoll") for i := 0; i != 7; i++ { err := coll.Find(nil).One(result) @@ -1895,7 +1895,7 @@ func (s *S) TestSelectServersWithMongos(c *C) { q22b := s.countQueries(c, "localhost:40022") q23b := s.countQueries(c, "localhost:40023") - switch hostPort(master) { + switch hostPort(main) { case "40021": c.Check(q21b-q21a, Equals, 0) c.Check(q22b-q22a, Equals, 5) diff --git a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/server.go b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/server.go index 4143e5d597..6e5560c1af 100644 --- a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/server.go +++ b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/server.go @@ -50,7 +50,7 @@ func (dial dialer) isSet() bool { } type mongoServerInfo struct { - Master bool + Main bool Mongos bool Tags bson.D MaxWireVersion int @@ -135,7 +135,7 @@ func (server *MongoServer) AcquireSocket(poolLimit int, timeout time.Duration) ( // generally be done through server.AcquireSocket(). func (server *MongoServer) Connect(timeout time.Duration) (*MongoSocket, error) { server.RLock() - master := server.info.Master + main := server.info.Main dial := server.dial server.RUnlock() @@ -160,7 +160,7 @@ func (server *MongoServer) Connect(timeout time.Duration) (*MongoSocket, error) } logf("Connection to %s established.", server.Addr) - stats.conn(+1, master) + stats.conn(+1, main) return NewSocket(server, conn, timeout), nil } @@ -273,7 +273,7 @@ func (server *MongoServer) pinger(loop bool) { op := QueryOp{ Collection: "admin.$cmd", Query: bson.D{{"ping", 1}}, - Flags: flagSlaveOk, + Flags: flagSubordinateOk, Limit: -1, } for { @@ -401,9 +401,9 @@ func (servers *mongoServers) BestFit(mode Mode, serverTags []bson.D) *MongoServe switch { case serverTags != nil && !next.info.Mongos && !next.hasTags(serverTags): // Must have requested tags. - case next.info.Master != best.info.Master && mode != Nearest: - // Prefer slaves, unless the mode is PrimaryPreferred. - swap = (mode == PrimaryPreferred) != best.info.Master + case next.info.Main != best.info.Main && mode != Nearest: + // Prefer subordinates, unless the mode is PrimaryPreferred. + swap = (mode == PrimaryPreferred) != best.info.Main case absDuration(next.pingValue-best.pingValue) > 15*time.Millisecond: // Prefer nearest server. swap = next.pingValue < best.pingValue diff --git a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/session.go b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/session.go index b1b82f0451..f593a3b87e 100644 --- a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/session.go +++ b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/session.go @@ -60,9 +60,9 @@ const ( type Session struct { m sync.RWMutex cluster_ *mongoCluster - slaveSocket *MongoSocket - masterSocket *MongoSocket - slaveOk bool + subordinateSocket *MongoSocket + mainSocket *MongoSocket + subordinateOk bool consistency Mode queryConfig query safeOp *QueryOp @@ -77,7 +77,7 @@ type Session struct { } type MongoSession interface { - AcquireSocketPrivate(slaveOk bool) (*MongoSocket, error) + AcquireSocketPrivate(subordinateOk bool) (*MongoSocket, error) } type Database struct { @@ -508,11 +508,11 @@ func newSession(consistency Mode, cluster *mongoCluster, timeout time.Duration) func copySession(session *Session, keepCreds bool) (s *Session) { cluster := session.cluster() cluster.Acquire() - if session.masterSocket != nil { - session.masterSocket.Acquire() + if session.mainSocket != nil { + session.mainSocket.Acquire() } - if session.slaveSocket != nil { - session.slaveSocket.Acquire() + if session.subordinateSocket != nil { + session.subordinateSocket.Acquire() } var creds []Credential if keepCreds { @@ -789,11 +789,11 @@ func (db *Database) Logout() { } } if found { - if session.masterSocket != nil { - session.masterSocket.Logout(dbname) + if session.mainSocket != nil { + session.mainSocket.Logout(dbname) } - if session.slaveSocket != nil { - session.slaveSocket.Logout(dbname) + if session.subordinateSocket != nil { + session.subordinateSocket.Logout(dbname) } } session.m.Unlock() @@ -803,11 +803,11 @@ func (db *Database) Logout() { func (s *Session) LogoutAll() { s.m.Lock() for _, cred := range s.creds { - if s.masterSocket != nil { - s.masterSocket.Logout(cred.Source) + if s.mainSocket != nil { + s.mainSocket.Logout(cred.Source) } - if s.slaveSocket != nil { - s.slaveSocket.Logout(cred.Source) + if s.subordinateSocket != nil { + s.subordinateSocket.Logout(cred.Source) } } s.creds = s.creds[0:0] @@ -1622,7 +1622,7 @@ func (s *Session) cluster() *mongoCluster { // guarantees according to the current consistency setting for the session. func (s *Session) Refresh() { s.m.Lock() - s.slaveOk = s.consistency != Strong + s.subordinateOk = s.consistency != Strong s.unsetSocket() s.m.Unlock() } @@ -1669,15 +1669,15 @@ func (s *Session) Refresh() { // connection is unsuitable (to a secondary server in a Strong session). func (s *Session) SetMode(consistency Mode, refresh bool) { s.m.Lock() - debugf("Session %p: setting mode %d with refresh=%v (master=%p, slave=%p)", s, consistency, refresh, s.masterSocket, s.slaveSocket) + debugf("Session %p: setting mode %d with refresh=%v (main=%p, subordinate=%p)", s, consistency, refresh, s.mainSocket, s.subordinateSocket) s.consistency = consistency if refresh { - s.slaveOk = s.consistency != Strong + s.subordinateOk = s.consistency != Strong s.unsetSocket() } else if s.consistency == Strong { - s.slaveOk = false - } else if s.masterSocket == nil { - s.slaveOk = true + s.subordinateOk = false + } else if s.mainSocket == nil { + s.subordinateOk = true } s.m.Unlock() } @@ -1705,11 +1705,11 @@ func (s *Session) SetSyncTimeout(d time.Duration) { func (s *Session) SetSocketTimeout(d time.Duration) { s.m.Lock() s.sockTimeout = d - if s.masterSocket != nil { - s.masterSocket.SetTimeout(d) + if s.mainSocket != nil { + s.mainSocket.SetTimeout(d) } - if s.slaveSocket != nil { - s.slaveSocket.SetTimeout(d) + if s.subordinateSocket != nil { + s.subordinateSocket.SetTimeout(d) } s.m.Unlock() } @@ -2265,9 +2265,9 @@ func (c *Collection) NewIter(session *Session, firstBatch []bson.Raw, cursorId i var server *MongoServer csession := c.Database.Session csession.m.RLock() - socket := csession.masterSocket + socket := csession.mainSocket if socket == nil { - socket = csession.slaveSocket + socket = csession.subordinateSocket } if socket != nil { server = socket.Server() @@ -3378,8 +3378,8 @@ func (q *Query) Tail(timeout time.Duration) *Iter { func (s *Session) prepareQuery(op *QueryOp) { s.m.RLock() op.mode = s.consistency - if s.slaveOk { - op.Flags |= flagSlaveOk + if s.subordinateOk { + op.Flags |= flagSubordinateOk } s.m.RUnlock() return @@ -4161,20 +4161,20 @@ func (s *Session) BuildInfo() (info BuildInfo, err error) { // --------------------------------------------------------------------------- // Internal session handling helpers. -func (s *Session) AcquireSocketPrivate(slaveOk bool) (*MongoSocket, error) { +func (s *Session) AcquireSocketPrivate(subordinateOk bool) (*MongoSocket, error) { // Read-only lock to check for previously reserved socket. s.m.RLock() - // If there is a slave socket reserved and its use is acceptable, take it as long - // as there isn't a master socket which would be preferred by the read preference mode. - if s.slaveSocket != nil && s.slaveOk && slaveOk && (s.masterSocket == nil || s.consistency != PrimaryPreferred && s.consistency != Monotonic) { - socket := s.slaveSocket + // If there is a subordinate socket reserved and its use is acceptable, take it as long + // as there isn't a main socket which would be preferred by the read preference mode. + if s.subordinateSocket != nil && s.subordinateOk && subordinateOk && (s.mainSocket == nil || s.consistency != PrimaryPreferred && s.consistency != Monotonic) { + socket := s.subordinateSocket socket.Acquire() s.m.RUnlock() return socket, nil } - if s.masterSocket != nil { - socket := s.masterSocket + if s.mainSocket != nil { + socket := s.mainSocket socket.Acquire() s.m.RUnlock() return socket, nil @@ -4186,17 +4186,17 @@ func (s *Session) AcquireSocketPrivate(slaveOk bool) (*MongoSocket, error) { s.m.Lock() defer s.m.Unlock() - if s.slaveSocket != nil && s.slaveOk && slaveOk && (s.masterSocket == nil || s.consistency != PrimaryPreferred && s.consistency != Monotonic) { - s.slaveSocket.Acquire() - return s.slaveSocket, nil + if s.subordinateSocket != nil && s.subordinateOk && subordinateOk && (s.mainSocket == nil || s.consistency != PrimaryPreferred && s.consistency != Monotonic) { + s.subordinateSocket.Acquire() + return s.subordinateSocket, nil } - if s.masterSocket != nil { - s.masterSocket.Acquire() - return s.masterSocket, nil + if s.mainSocket != nil { + s.mainSocket.Acquire() + return s.mainSocket, nil } // Still not good. We need a new socket. - sock, err := s.cluster().AcquireSocket(s.consistency, slaveOk && s.slaveOk, s.syncTimeout, s.sockTimeout, s.queryConfig.op.ServerTags, s.poolLimit) + sock, err := s.cluster().AcquireSocket(s.consistency, subordinateOk && s.subordinateOk, s.syncTimeout, s.sockTimeout, s.queryConfig.op.ServerTags, s.poolLimit) if err != nil { return nil, err } @@ -4209,16 +4209,16 @@ func (s *Session) AcquireSocketPrivate(slaveOk bool) (*MongoSocket, error) { // Keep track of the new socket, if necessary. // Note that, as a special case, if the Eventual session was - // not refreshed (s.slaveSocket != nil), it means the developer + // not refreshed (s.subordinateSocket != nil), it means the developer // asked to preserve an existing reserved socket, so we'll - // keep a master one around too before a Refresh happens. - if s.consistency != Eventual || s.slaveSocket != nil { + // keep a main one around too before a Refresh happens. + if s.consistency != Eventual || s.subordinateSocket != nil { s.setSocket(sock) } - // Switch over a Monotonic session to the master. - if !slaveOk && s.consistency == Monotonic { - s.slaveOk = false + // Switch over a Monotonic session to the main. + if !subordinateOk && s.consistency == Monotonic { + s.subordinateOk = false } return sock, nil @@ -4239,29 +4239,29 @@ func (s *Session) AcquireSocketDirect() (*MongoSocket, error) { // setSocket binds socket to this section. func (s *Session) setSocket(socket *MongoSocket) { info := socket.Acquire() - if info.Master { - if s.masterSocket != nil { - panic("setSocket(master) with existing master socket reserved") + if info.Main { + if s.mainSocket != nil { + panic("setSocket(main) with existing main socket reserved") } - s.masterSocket = socket + s.mainSocket = socket } else { - if s.slaveSocket != nil { - panic("setSocket(slave) with existing slave socket reserved") + if s.subordinateSocket != nil { + panic("setSocket(subordinate) with existing subordinate socket reserved") } - s.slaveSocket = socket + s.subordinateSocket = socket } } -// unsetSocket releases any slave and/or master sockets reserved. +// unsetSocket releases any subordinate and/or main sockets reserved. func (s *Session) unsetSocket() { - if s.masterSocket != nil { - s.masterSocket.Release() + if s.mainSocket != nil { + s.mainSocket.Release() } - if s.slaveSocket != nil { - s.slaveSocket.Release() + if s.subordinateSocket != nil { + s.subordinateSocket.Release() } - s.masterSocket = nil - s.slaveSocket = nil + s.mainSocket = nil + s.subordinateSocket = nil } func (iter *Iter) replyFunc() replyFunc { diff --git a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/session_test.go b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/session_test.go index e8ddbc1def..bc49e70f33 100644 --- a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/session_test.go +++ b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/session_test.go @@ -2530,7 +2530,7 @@ func (s *S) TestSafeParameters(c *C) { // Tweak the safety parameters to something unachievable. session.SetSafe(&mgo.Safe{W: 4, WTimeout: 100}) err = coll.Insert(M{"_id": 1}) - c.Assert(err, ErrorMatches, "timeout|timed out waiting for slaves|Not enough data-bearing nodes|waiting for replication timed out") // :-( + c.Assert(err, ErrorMatches, "timeout|timed out waiting for subordinates|Not enough data-bearing nodes|waiting for replication timed out") // :-( if !s.versionAtLeast(2, 6) { // 2.6 turned it into a query error. c.Assert(err.(*mgo.LastError).WTimeout, Equals, true) diff --git a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/stats.go b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/stats.go index 28cf505351..b5e2b3f0c7 100644 --- a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/stats.go +++ b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/stats.go @@ -51,8 +51,8 @@ func ResetStats() { type Stats struct { Clusters int - MasterConns int - SlaveConns int + MainConns int + SubordinateConns int SentOps int ReceivedOps int ReceivedDocs int @@ -69,13 +69,13 @@ func (stats *Stats) cluster(delta int) { } } -func (stats *Stats) conn(delta int, master bool) { +func (stats *Stats) conn(delta int, main bool) { if stats != nil { statsMutex.Lock() - if master { - stats.MasterConns += delta + if main { + stats.MainConns += delta } else { - stats.SlaveConns += delta + stats.SubordinateConns += delta } statsMutex.Unlock() } diff --git a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/suite_test.go b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/suite_test.go index ea3806f58e..c6b18297fb 100644 --- a/src/normous/gotools/vendor/src/github.com/10gen/llmgo/suite_test.go +++ b/src/normous/gotools/vendor/src/github.com/10gen/llmgo/suite_test.go @@ -122,7 +122,7 @@ func (s *S) TearDownTest(c *C) { } func (s *S) Stop(host string) { - // Give a moment for slaves to sync and avoid getting rollback issues. + // Give a moment for subordinates to sync and avoid getting rollback issues. panicOnWindows() time.Sleep(2 * time.Second) err := run("cd _testdb && supervisorctl stop " + supvName(host)) diff --git a/src/normous/gotools/vendor/src/github.com/google/gopacket/layers/iana_ports.go b/src/normous/gotools/vendor/src/github.com/google/gopacket/layers/iana_ports.go index fbf281ef30..0c21b56472 100644 --- a/src/normous/gotools/vendor/src/github.com/google/gopacket/layers/iana_ports.go +++ b/src/normous/gotools/vendor/src/github.com/google/gopacket/layers/iana_ports.go @@ -1391,7 +1391,7 @@ var tcpPortNames = map[TCPPort]string{ 1721: "caicci", 1722: "hks-lm", 1723: "pptp", - 1724: "csbphonemaster", + 1724: "csbphonemain", 1725: "iden-ralp", 1726: "iberiagames", 1727: "winddx", @@ -1922,7 +1922,7 @@ var tcpPortNames = map[TCPPort]string{ 2257: "simple-tx-rx", 2258: "rcts", 2260: "apc-2260", - 2261: "comotionmaster", + 2261: "comotionmain", 2262: "comotionback", 2263: "ecwcfg", 2264: "apx500api-1", @@ -2060,8 +2060,8 @@ var tcpPortNames = map[TCPPort]string{ 2399: "fmpro-fdal", 2400: "opequus-server", 2401: "cvspserver", - 2402: "taskmaster2000", - 2403: "taskmaster2000", + 2402: "taskmain2000", + 2403: "taskmain2000", 2404: "iec-104", 2405: "trc-netpoll", 2406: "jediserver", @@ -2751,7 +2751,7 @@ var tcpPortNames = map[TCPPort]string{ 3099: "chmd", 3100: "opcon-xps", 3101: "hp-pxpib", - 3102: "slslavemon", + 3102: "slsubordinatemon", 3103: "autocuesmi", 3104: "autocuelog", 3105: "cardbox", @@ -2764,7 +2764,7 @@ var tcpPortNames = map[TCPPort]string{ 3112: "ksysguard", 3113: "cs-auth-svr", 3114: "ccmad", - 3115: "mctet-master", + 3115: "mctet-main", 3116: "mctet-gateway", 3117: "mctet-jserv", 3118: "pkagent", @@ -2824,7 +2824,7 @@ var tcpPortNames = map[TCPPort]string{ 3173: "serverview-icc", 3174: "armi-server", 3175: "t1-e1-over-ip", - 3176: "ars-master", + 3176: "ars-main", 3177: "phonex-port", 3178: "radclientport", 3179: "h2gf-w-2m", @@ -4564,7 +4564,7 @@ var tcpPortNames = map[TCPPort]string{ 6432: "pgbouncer", 6442: "tarp", 6443: "sun-sr-https", - 6444: "sge-qmaster", + 6444: "sge-qmain", 6445: "sge-execd", 6446: "mysql-proxy", 6455: "skip-cert-recv", @@ -4604,7 +4604,7 @@ var tcpPortNames = map[TCPPort]string{ 6566: "sane-port", 6568: "canit-store", 6579: "affiliate", - 6580: "parsec-master", + 6580: "parsec-main", 6581: "parsec-peer", 6582: "parsec-game", 6583: "joaJewelSuite", @@ -5597,7 +5597,7 @@ var tcpPortNames = map[TCPPort]string{ 33333: "dgi-serv", 33334: "speedtrace", 33434: "traceroute", - 33656: "snip-slave", + 33656: "snip-subordinate", 34249: "turbonote-2", 34378: "p-net-local", 34379: "p-net-remote", @@ -7070,7 +7070,7 @@ var udpPortNames = map[UDPPort]string{ 1721: "caicci", 1722: "hks-lm", 1723: "pptp", - 1724: "csbphonemaster", + 1724: "csbphonemain", 1725: "iden-ralp", 1726: "iberiagames", 1727: "winddx", @@ -7596,7 +7596,7 @@ var udpPortNames = map[UDPPort]string{ 2257: "simple-tx-rx", 2258: "rcts", 2260: "apc-2260", - 2261: "comotionmaster", + 2261: "comotionmain", 2262: "comotionback", 2263: "ecwcfg", 2264: "apx500api-1", @@ -7727,8 +7727,8 @@ var udpPortNames = map[UDPPort]string{ 2399: "fmpro-fdal", 2400: "opequus-server", 2401: "cvspserver", - 2402: "taskmaster2000", - 2403: "taskmaster2000", + 2402: "taskmain2000", + 2403: "taskmain2000", 2404: "iec-104", 2405: "trc-netpoll", 2406: "jediserver", @@ -8414,7 +8414,7 @@ var udpPortNames = map[UDPPort]string{ 3099: "chmd", 3100: "opcon-xps", 3101: "hp-pxpib", - 3102: "slslavemon", + 3102: "slsubordinatemon", 3103: "autocuesmi", 3104: "autocuetime", 3105: "cardbox", @@ -8427,7 +8427,7 @@ var udpPortNames = map[UDPPort]string{ 3112: "ksysguard", 3113: "cs-auth-svr", 3114: "ccmad", - 3115: "mctet-master", + 3115: "mctet-main", 3116: "mctet-gateway", 3117: "mctet-jserv", 3118: "pkagent", @@ -8486,7 +8486,7 @@ var udpPortNames = map[UDPPort]string{ 3173: "serverview-icc", 3174: "armi-server", 3175: "t1-e1-over-ip", - 3176: "ars-master", + 3176: "ars-main", 3177: "phonex-port", 3178: "radclientport", 3179: "h2gf-w-2m", @@ -10120,7 +10120,7 @@ var udpPortNames = map[UDPPort]string{ 6420: "nim-vdrshell", 6421: "nim-wan", 6443: "sun-sr-https", - 6444: "sge-qmaster", + 6444: "sge-qmain", 6445: "sge-execd", 6446: "mysql-proxy", 6455: "skip-cert-recv", @@ -10160,7 +10160,7 @@ var udpPortNames = map[UDPPort]string{ 6566: "sane-port", 6568: "rp-reputation", 6579: "affiliate", - 6580: "parsec-master", + 6580: "parsec-main", 6581: "parsec-peer", 6582: "parsec-game", 6583: "joaJewelSuite", @@ -10971,7 +10971,7 @@ var udpPortNames = map[UDPPort]string{ 25902: "nilinkanalyst", 25903: "niprobe", 25954: "bf-game", - 25955: "bf-master", + 25955: "bf-main", 26000: "quake", 26133: "scscp", 26208: "wnn6-ds", @@ -11028,7 +11028,7 @@ var udpPortNames = map[UDPPort]string{ 33331: "diamondport", 33334: "speedtrace-disc", 33434: "traceroute", - 33656: "snip-slave", + 33656: "snip-subordinate", 34249: "turbonote-2", 34378: "p-net-local", 34379: "p-net-remote", diff --git a/src/normous/gotools/vendor/src/github.com/google/gopacket/macs/valid_mac_prefixes.go b/src/normous/gotools/vendor/src/github.com/google/gopacket/macs/valid_mac_prefixes.go index 4afee40f4f..aab4529b9a 100644 --- a/src/normous/gotools/vendor/src/github.com/google/gopacket/macs/valid_mac_prefixes.go +++ b/src/normous/gotools/vendor/src/github.com/google/gopacket/macs/valid_mac_prefixes.go @@ -444,7 +444,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{0, 1, 170}: "Airspan Communications, Ltd.", [3]byte{0, 1, 171}: "Main Street Networks", [3]byte{0, 1, 172}: "Sitara Networks, Inc.", - [3]byte{0, 1, 173}: "Coach Master International d.b.a. CMI Worldwide, Inc.", + [3]byte{0, 1, 173}: "Coach Main International d.b.a. CMI Worldwide, Inc.", [3]byte{0, 1, 174}: "Trex Enterprises", [3]byte{0, 1, 175}: "Artesyn Embedded Technologies", [3]byte{0, 1, 176}: "Fulltek Technology Co., Ltd.", @@ -2269,7 +2269,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{0, 8, 229}: "IDK Corporation", [3]byte{0, 8, 230}: "Littlefeet", [3]byte{0, 8, 231}: "SHI ControlSystems,Ltd.", - [3]byte{0, 8, 232}: "Excel Master Ltd.", + [3]byte{0, 8, 232}: "Excel Main Ltd.", [3]byte{0, 8, 233}: "NextGig", [3]byte{0, 8, 234}: "Motion Control Engineering, Inc", [3]byte{0, 8, 235}: "ROMWin Co.,Ltd.", @@ -3249,7 +3249,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{0, 12, 186}: "Jamex, Inc.", [3]byte{0, 12, 187}: "ISKRAEMECO", [3]byte{0, 12, 188}: "Iscutum", - [3]byte{0, 12, 189}: "Interface Masters, Inc", + [3]byte{0, 12, 189}: "Interface Mains, Inc", [3]byte{0, 12, 190}: "Innominate Security Technologies AG", [3]byte{0, 12, 191}: "Holy Stone Ent. Co., Ltd.", [3]byte{0, 12, 192}: "Genera Oy", @@ -5087,7 +5087,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{0, 19, 232}: "Intel Corporate", [3]byte{0, 19, 233}: "VeriWave, Inc.", [3]byte{0, 19, 234}: "Kamstrup A/S", - [3]byte{0, 19, 235}: "Sysmaster Corporation", + [3]byte{0, 19, 235}: "Sysmain Corporation", [3]byte{0, 19, 236}: "Sunbay Software AG", [3]byte{0, 19, 237}: "PSIA", [3]byte{0, 19, 238}: "JBX Designs Inc.", @@ -6220,7 +6220,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{0, 24, 85}: "Aeromaritime Systembau GmbH", [3]byte{0, 24, 86}: "EyeFi, Inc", [3]byte{0, 24, 87}: "Unilever R&D", - [3]byte{0, 24, 88}: "TagMaster AB", + [3]byte{0, 24, 88}: "TagMain AB", [3]byte{0, 24, 89}: "Strawberry Linux Co.,Ltd.", [3]byte{0, 24, 90}: "uControl, Inc.", [3]byte{0, 24, 91}: "Network Chemistry, Inc", @@ -7891,7 +7891,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{0, 30, 220}: "Sony Ericsson Mobile Communications AB", [3]byte{0, 30, 221}: "WASKO S.A.", [3]byte{0, 30, 222}: "BYD COMPANY LIMITED", - [3]byte{0, 30, 223}: "Master Industrialization Center Kista", + [3]byte{0, 30, 223}: "Main Industrialization Center Kista", [3]byte{0, 30, 224}: "Urmet Domus SpA", [3]byte{0, 30, 225}: "Samsung Electronics Co.,Ltd", [3]byte{0, 30, 226}: "Samsung Electronics Co.,Ltd", @@ -8486,7 +8486,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{0, 33, 47}: "Phoebe Micro Inc.", [3]byte{0, 33, 48}: "Keico Hightech Inc.", [3]byte{0, 33, 49}: "Blynke Inc.", - [3]byte{0, 33, 50}: "Masterclock, Inc.", + [3]byte{0, 33, 50}: "Mainclock, Inc.", [3]byte{0, 33, 51}: "Building B, Inc", [3]byte{0, 33, 52}: "Brandywine Communications", [3]byte{0, 33, 53}: "ALCATEL-LUCENT", @@ -9192,7 +9192,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{0, 35, 241}: "Sony Ericsson Mobile Communications", [3]byte{0, 35, 242}: "TVLogic", [3]byte{0, 35, 243}: "Glocom, Inc.", - [3]byte{0, 35, 244}: "Masternaut", + [3]byte{0, 35, 244}: "Mainnaut", [3]byte{0, 35, 245}: "WILO SE", [3]byte{0, 35, 246}: "Softwell Technology Co., Ltd.", [3]byte{0, 35, 247}: "PRIVATE", @@ -15977,7 +15977,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{116, 136, 139}: "ADB Broadband Italia", [3]byte{116, 142, 8}: "Bestek Corp.", [3]byte{116, 142, 248}: "Brocade Communications Systems, Inc.", - [3]byte{116, 143, 27}: "MasterImage 3D", + [3]byte{116, 143, 27}: "MainImage 3D", [3]byte{116, 143, 77}: "MEN Mikro Elektronik GmbH", [3]byte{116, 144, 80}: "Renesas Electronics Corporation", [3]byte{116, 145, 26}: "Ruckus Wireless", @@ -17197,7 +17197,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{160, 109, 9}: "Intelcan Technosystems Inc.", [3]byte{160, 110, 80}: "Nanotek Elektronik Sistemler Ltd. Sti.", [3]byte{160, 113, 169}: "Nokia Corporation", - [3]byte{160, 115, 50}: "Cashmaster International Limited", + [3]byte{160, 115, 50}: "Cashmain International Limited", [3]byte{160, 115, 252}: "Rancore Technologies Private Limited", [3]byte{160, 117, 145}: "Samsung Electronics Co.,Ltd", [3]byte{160, 119, 113}: "Vialis BV", @@ -17282,7 +17282,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{164, 37, 27}: "Avaya, Inc", [3]byte{164, 41, 64}: "Shenzhen YOUHUA Technology Co., Ltd", [3]byte{164, 41, 183}: "bluesky", - [3]byte{164, 44, 8}: "Masterwork Automodules", + [3]byte{164, 44, 8}: "Mainwork Automodules", [3]byte{164, 51, 209}: "Fibrlink Communications Co.,Ltd.", [3]byte{164, 56, 252}: "Plastic Logic", [3]byte{164, 58, 105}: "Vers Inc", @@ -19515,7 +19515,7 @@ var validMACPrefixMap = map[[3]byte]string{ [3]byte{244, 165, 42}: "Hawa Technologies Inc", [3]byte{244, 172, 193}: "CISCO SYSTEMS, INC.", [3]byte{244, 177, 100}: "Lightning Telecommunications Technology Co. Ltd", - [3]byte{244, 179, 129}: "WindowMaster A/S", + [3]byte{244, 179, 129}: "WindowMain A/S", [3]byte{244, 181, 47}: "Juniper networks", [3]byte{244, 181, 73}: "Yeastar Technology Co., Ltd.", [3]byte{244, 182, 229}: "TerraSem Co.,Ltd", diff --git a/src/normous/gotools/vendor/src/golang.org/x/crypto/hkdf/example_test.go b/src/normous/gotools/vendor/src/golang.org/x/crypto/hkdf/example_test.go index df84395129..a44be11ec3 100644 --- a/src/normous/gotools/vendor/src/golang.org/x/crypto/hkdf/example_test.go +++ b/src/normous/gotools/vendor/src/golang.org/x/crypto/hkdf/example_test.go @@ -13,14 +13,14 @@ import ( "io" ) -// Usage example that expands one master key into three other cryptographically +// Usage example that expands one main key into three other cryptographically // secure keys. func Example_usage() { // Underlying hash function to use hash := sha256.New - // Cryptographically secure master key. - master := []byte{0x00, 0x01, 0x02, 0x03} // i.e. NOT this. + // Cryptographically secure main key. + main := []byte{0x00, 0x01, 0x02, 0x03} // i.e. NOT this. // Non secret salt, optional (can be nil) // Recommended: hash-length sized random @@ -32,11 +32,11 @@ func Example_usage() { } // Non secret context specific info, optional (can be nil). - // Note, independent from the master key. + // Note, independent from the main key. info := []byte{0x03, 0x14, 0x15, 0x92, 0x65} // Create the key derivation function - hkdf := hkdf.New(hash, master, salt, info) + hkdf := hkdf.New(hash, main, salt, info) // Generate the required keys keys := make([][]byte, 3) diff --git a/src/normous/gotools/vendor/src/golang.org/x/crypto/hkdf/hkdf_test.go b/src/normous/gotools/vendor/src/golang.org/x/crypto/hkdf/hkdf_test.go index cee659bcdb..69edaa3618 100644 --- a/src/normous/gotools/vendor/src/golang.org/x/crypto/hkdf/hkdf_test.go +++ b/src/normous/gotools/vendor/src/golang.org/x/crypto/hkdf/hkdf_test.go @@ -16,7 +16,7 @@ import ( type hkdfTest struct { hash func() hash.Hash - master []byte + main []byte salt []byte info []byte out []byte @@ -233,7 +233,7 @@ var hkdfTests = []hkdfTest{ func TestHKDF(t *testing.T) { for i, tt := range hkdfTests { - hkdf := New(tt.hash, tt.master, tt.salt, tt.info) + hkdf := New(tt.hash, tt.main, tt.salt, tt.info) out := make([]byte, len(tt.out)) n, err := io.ReadFull(hkdf, out) @@ -249,7 +249,7 @@ func TestHKDF(t *testing.T) { func TestHKDFMultiRead(t *testing.T) { for i, tt := range hkdfTests { - hkdf := New(tt.hash, tt.master, tt.salt, tt.info) + hkdf := New(tt.hash, tt.main, tt.salt, tt.info) out := make([]byte, len(tt.out)) for b := 0; b < len(tt.out); b++ { @@ -267,10 +267,10 @@ func TestHKDFMultiRead(t *testing.T) { func TestHKDFLimit(t *testing.T) { hash := sha1.New - master := []byte{0x00, 0x01, 0x02, 0x03} + main := []byte{0x00, 0x01, 0x02, 0x03} info := []byte{} - hkdf := New(hash, master, nil, info) + hkdf := New(hash, main, nil, info) limit := hash().Size() * 255 out := make([]byte, limit) @@ -336,7 +336,7 @@ func Benchmark64ByteSHA512Stream(b *testing.B) { } func benchmarkHKDFSingle(hasher func() hash.Hash, block int, b *testing.B) { - master := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07} + main := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07} salt := []byte{0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17} info := []byte{0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27} out := make([]byte, block) @@ -345,13 +345,13 @@ func benchmarkHKDFSingle(hasher func() hash.Hash, block int, b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { - hkdf := New(hasher, master, salt, info) + hkdf := New(hasher, main, salt, info) io.ReadFull(hkdf, out) } } func benchmarkHKDFStream(hasher func() hash.Hash, block int, b *testing.B) { - master := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07} + main := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07} salt := []byte{0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17} info := []byte{0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27} out := make([]byte, block) @@ -359,11 +359,11 @@ func benchmarkHKDFStream(hasher func() hash.Hash, block int, b *testing.B) { b.SetBytes(int64(block)) b.ResetTimer() - hkdf := New(hasher, master, salt, info) + hkdf := New(hasher, main, salt, info) for i := 0; i < b.N; i++ { _, err := io.ReadFull(hkdf, out) if err != nil { - hkdf = New(hasher, master, salt, info) + hkdf = New(hasher, main, salt, info) i-- } } diff --git a/src/normous/gotools/vendor/src/golang.org/x/text/language/display/tables.go b/src/normous/gotools/vendor/src/golang.org/x/text/language/display/tables.go index be0fcdc0b1..b087312381 100644 --- a/src/normous/gotools/vendor/src/golang.org/x/text/language/display/tables.go +++ b/src/normous/gotools/vendor/src/golang.org/x/text/language/display/tables.go @@ -548,7 +548,7 @@ var langHeaders = [261]header{ "nmedumbacaddocaribecayugaatsamcebuanuchigachibchachagataichuukésmari" + "xíriga chinookchoctawchipewyanucheroquicheyennekurdu centralcópticuc" + "apiznonturcu de Crimeafrancés criollu seselwakashubianudakotadargwat" + - "aitadelawareslavedogribdinkazarmadogribaxu sorbiudusun centraldualan" + + "aitadelawaresubordinatedogribdinkazarmadogribaxu sorbiudusun centraldualan" + "eerlandés mediujola-fonyidyuladazagaembúefikemilianuexipciu antiguue" + "kajukelamitainglés mediuyupik centralewondoestremeñufangfilipínfinla" + "ndés de Tornedalenfonfrancés cajunfrancés mediufrancés antiguuarpita" + @@ -1584,7 +1584,7 @@ var langHeaders = [261]header{ "afarskiabhaskiavestanskiafrikansakanamharskiaragonskiarapskiasamskiavars" + "kiajmaraazerbejdžanskibaškirskibjeloruskibugarskibislamabambarabenga" + "lskitibetanskibretonskibosanskikatalonskičečenskičamorokorzikanskikr" + - "ičeškistaroslavenskičuvaškivelškidanskinjemačkidivehidžongaevegrčkie" + + "ičeškistarosubordinatenskičuvaškivelškidanskinjemačkidivehidžongaevegrčkie" + "ngleskiesperantošpanskiestonskibaskijskiperzijskifulahfinskifidžijsk" + "ifarskifrancuskizapadni frizijskiirskiškotski galskigalicijskigvaran" + "igudžaratimankshausahebrejskihindihiri motuhrvatskihaićanski kreolsk" + @@ -1609,7 +1609,7 @@ var langHeaders = [261]header{ "edumbakadokaripskikajugaatsamcebuanočigačibčačagataičukeskimaričinuk" + "ski žargončoktavčipvijanskičirokičejenskicentralnokurdskikoptskikrim" + "ski turskiseselva kreolski francuskikašubijanskidakotadargvataitadel" + - "averslavedogribdinkazarmadogridonjolužičkosrpskidualasrednjovjekovni" + + "aversubordinatedogribdinkazarmadogridonjolužičkosrpskidualasrednjovjekovni" + " holandskijola-fonidiuladazagaembuefikstaroegipatskiekajukelamitskis" + "rednjovjekovni engleskievondofangfilipinofonsrednjovjekovni francusk" + "istarofrancuskisjeverni frizijskiistočnofrizijskifriulijskigagagaušk" + @@ -6137,7 +6137,7 @@ var langHeaders = [261]header{ "ojpuriBikolBiniKomSiksikaBrajBodoAkooseBuriatBugineeskBuluBlinMedumb" + "aKaddoKaribyskCayugaAtsamCebuanoChigaChibchaChagataiChuukeeskMariChi" + "nook-jargonChoctawChipewyanCherokeeCheyenneSoranîKoptyskKrim-Tataars" + - "kKasjoebyskDakotaDargwaTaitaDelawareSlaveDogribDinkaZarmaDogriNeders" + + "kKasjoebyskDakotaDargwaTaitaDelawareSubordinateDogribDinkaZarmaDogriNeders" + "orbyskDualaMiddelnederlânskJola-FonyiDyulaDazagaEmbuEfikAldegyptyskE" + "kajukElamityskMiddelingelskEwondoFangFilipynskFonMiddelfrânskAldfrân" + "skNoard-FryskEast-FryskFriulyskGaGayoGbayaGeezGilberteeskMiddelheech" + @@ -6437,7 +6437,7 @@ var langHeaders = [261]header{ "uiBodoAkooseBuriatCànan nam BugisBuluBlinMedumbaCaddoCaribCayugaAtsa" + "mCebuanoChigaChibchaChagataiCànan ChuukMariChinuk WawaChoctawChipewy" + "anCherokeeCheyenneCùrdais MheadhanachCoptaisCapiznonTurcais Chriomac" + - "hSeiseallaisCaisiubaisDakotaDargwaTaitaDelawareSlaveyDogribDinkaZarm" + + "hSeiseallaisCaisiubaisDakotaDargwaTaitaDelawareSubordinateyDogribDinkaZarm" + "aDogriSòrbais ÌochdarachDusun MheadhanachDualaMeadhan-DhuitsisJola-F" + "onyiDyulaDazagaEmbuEfikÈipheitis ÀrsaidhEkajukElamaisMeadhan-Bheurla" + "Yupik MheadhanachEwondoCànan na h-ExtremaduraFangFilipinisMeänkieliF" + @@ -6746,7 +6746,7 @@ var langHeaders = [261]header{ "rjatischBugineesischBlinCaddoKariibischAtsamCebuanoTschibtschaTschag" + "ataischTrukesischTscheremissischChinookChoctawChipewyanCherokeeCheye" + "nneKoptischKrimtatarischKaschubischTakotaTargiinischDelaware-Schpraa" + - "chSlaveyTogribTinkaTogriNidersorbischTualaMittelniderländischTiulaEf" + + "chSubordinateyTogribTinkaTogriNidersorbischTualaMittelniderländischTiulaEf" + "ikischAltägyptischEkajukElamischMittelänglischEwondoPangwe-Schpraach" + "FilipinoFonMittelfranzösischAltfranzösischNordfriesischOschtfriesisc" + "hFriulischGaGayoGbayaGeezGilbertesischMittelhochtüütschAlthochtüütsc" + @@ -8757,7 +8757,7 @@ var langHeaders = [261]header{ "luBlinMedumbaCaddoKaribeschCayugaAtsamCebuanoKigaChibcha-SproochTsch" + "agataeschTrukeseschMariChinookChoctawChipewyanCherokeeCheyenneSorani" + "KopteschCapiznonKrimtatareschKaschubeschDakota-SproochDargineschTait" + - "aDelaware-SproochSlaveDogribDinka-SproochZarmaDogriNiddersorbeschZen" + + "aDelaware-SproochSubordinateDogribDinka-SproochZarmaDogriNiddersorbeschZen" + "tral-DusunDualaMëttelhollänneschJola-FonyiDyula-SproochDazagaKiembuE" + "fikEmilianeschEgypteschEkajukElameschMëttelengleschYup’ikEwondoExtre" + "madureschPangwe-SproochFilipinoMeänkieliFon-SproochCajunMëttelfransé" + @@ -10348,7 +10348,7 @@ var langHeaders = [261]header{ "ojpuribikolbinisiksikabrajbodobakossiburjatiskbuginesiskblincaddocar" + "ibatsamcebuanokigachibchatsjagataiskchuukesiskmarichinookchoctawchip" + "ewianskcherokeecheyennesoranikoptiskkrimtatariskseselwa (fransk-kreo" + - "lsk)kasjubiskdakotadargwataitadelawareslavejdogribdinkazarmadogrilåg" + + "lsk)kasjubiskdakotadargwataitadelawaresubordinatejdogribdinkazarmadogrilåg" + "sorbiskdualamellomnederlandskjola-fonyidyuladazagaembuefikgammalegyp" + "tiskekajukelamitemellomengelskewondofangfilippinskfonmellomfranskgam" + "malfransknordfrisiskaustfrisiskfriuliskgagayogbayageezgilbertesemell" + @@ -11449,7 +11449,7 @@ var langHeaders = [261]header{ "aarameicaraucanicarapahoarawakasturianawadhibelutschibalinaisbasaabe" + "dschabembabhojpuribikolbinisiksikabrajburiatbugiblincaddocaribicatsa" + "mcebuanochibchatschagataicchuukaismaripatuà chinookchoctawchipewyanc" + - "herokeecheyennecoptictirc crimeankaschubicdakotadargwadelawareslavey" + + "herokeecheyennecoptictirc crimeankaschubicdakotadargwadelawaresubordinatey" + "dogribdinkadogribass sorbdualaollandais mesaundiulaefikegipzian vegl" + "ekajukelamiticenglais mesaunewondofangfilippinofonfranzos mesaunfran" + "zos veglfris dal nordfris da l’ostfriulangagayogbayageezgilbertaistu" + @@ -17188,7 +17188,7 @@ const azLangStr string = "" + // Size: 3754 bytes "iyaavadhibalucbalibasabejabembabenaqərbi bəlucbxoçpuribikolbinisiksikəbr" + "ajbodoburyatbuginblinkeddokaribatsamsebuançiqaçibçaçağatayçukizmariçinuk" + " ləhçəsiçoktauçipevyançerokiçeyensorankoptkrım türkcəsiSeyşel kreol fran" + - "sızcasıkaşubyandakotadarqvataitadelaverslaveydoqribdinkazarmadoqriaşağı " + + "sızcasıkaşubyandakotadarqvataitadelaversubordinateydoqribdinkazarmadoqriaşağı " + "sorbdualaorta hollanddioladyuladazaqaembuefikqədim misirekacukelamitorta" + " ingilisevondofangfilippinfonorta fransızqədim fransızşimali frisfriulqa" + "qaqauzqanqayoqabayaqezqilbertorta yüksək almanqədim almanqondiqorontaloq" + @@ -18132,7 +18132,7 @@ const deLangStr string = "" + // Size: 5631 bytes "ischBraj-BhakhaBrahuiBodoAkooseBurjatischBuginesischBuluBlinMedumbaCaddo" + "KaribischCayugaAtsamCebuanoRukigaChibchaTschagataischChuukesischMariChin" + "ookChoctawChipewyanCherokeeCheyenneZentralkurdischKoptischCapiznonKrimta" + - "tarischSeychellenkreolKaschubischDakotaDarginischTaitaDelawareSlaveDogri" + + "tarischSeychellenkreolKaschubischDakotaDarginischTaitaDelawareSubordinateDogri" + "bDinkaZarmaDogriNiedersorbischZentral-DusunDualaMittelniederländischDiol" + "aDyulaDazagaEmbuEfikEmilianischÄgyptischEkajukElamischMittelenglischZent" + "ral-Alaska-YupikEwondoExtremadurischPangweFilipinoMeänkieliFonCajunMitte" + @@ -18456,7 +18456,7 @@ const enLangStr string = "" + // Size: 4978 bytes "ooseBuriatBugineseBuluBlinMedumbaCaddoCaribCayugaAtsamChakmaCebuanoChiga" + "ChibchaChagataiChuukeseMariChinook JargonChoctawChipewyanCherokeeCheyenn" + "eCentral KurdishCopticCapiznonCrimean TurkishSeselwa Creole FrenchKashub" + - "ianDakotaDargwaTaitaDelawareSlaveDogribDinkaZarmaDogriLower SorbianCentr" + + "ianDakotaDargwaTaitaDelawareSubordinateDogribDinkaZarmaDogriLower SorbianCentr" + "al DusunDualaMiddle DutchJola-FonyiDyulaDazagaEmbuEfikEmilianAncient Egy" + "ptianEkajukElamiteMiddle EnglishCentral YupikEwondoExtremaduranFangFilip" + "inoTornedalen FinnishFonCajun FrenchMiddle FrenchOld FrenchArpitanNorthe" + @@ -18706,7 +18706,7 @@ const esLangStr string = "" + // Size: 4366 bytes "cidentalbhoyapuríbicolbinikomsiksikabrajbodoakooseburiatobuginésbulublin" + "medumbacaddocaribecayugaatsamcebuanochigachibchachagatáitrukésmaríjerga " + "chinukchoctawchipewyancheroquicheyenekurdo soranicoptotártaro de Crimeac" + - "riollo seychelensecasubiodakotadargvataitadelawareslavedogribdinkazarmad" + + "riollo seychelensecasubiodakotadargvataitadelawaresubordinatedogribdinkazarmad" + "ogribajo sorbiodualaneerlandés mediojola-fonyidiuladazagaembuefikegipcio" + " antiguoekajukelamitainglés medioewondofangfilipinofonfrancés cajúnfranc" + "és mediofrancés antiguofrisón septentrionalfrisón orientalfriulanogagag" + @@ -19697,7 +19697,7 @@ var frLangIdx = []uint16{ // 615 elements const frCALangStr string = "" + // Size: 551 bytes "azerbaïdjanaiscrigujaratiyi de Sichuankuanyamakalaallisutodiasame du Nor" + "dsangovolapükadyguévieil anglaisbenabicolbilenmedumbatchagataychinookkur" + - "de centralslavetlichoyupik centralewondocajunvieux haut-allemandilocanok" + + "de centralsubordinatetlichoyupik centralewondocajunvieux haut-allemandilocanok" + "abardekenyangkölschliveluochinois classiquemeta’marwarimentawaibas allem" + "andao naganewari classiquenkolepalauanallemand de Pennsylvaniebas allema" + "nd mennonitevieux persepalatinancien occitanrarotongaaroumainsantalikurd" + @@ -20241,7 +20241,7 @@ const hrLangStr string = "" + // Size: 4673 bytes "afarskiabhaskiavestičkiafrikaansakanskiamharskiaragonskiarapskiasamskiav" + "arskiajmarskiazerbajdžanskibaškirskibjeloruskibugarskibislamabambarabang" + "latibetskibretonskibosanskikatalonskičečenskichamorrokorzičkicreečeškicr" + - "kvenoslavenskičuvaškivelškidanskinjemačkidivehidzongkhaewegrčkiengleskie" + + "kvenosubordinatenskičuvaškivelškidanskinjemačkidivehidzongkhaewegrčkiengleskie" + "sperantošpanjolskiestonskibaskijskiperzijskifulafinskifidžijskiferojskif" + "rancuskizapadnofrizijskiirskiškotski gaelskigalicijskigvaranskigudžarats" + "kimanskihausahebrejskihindskihiri motuhrvatskihaićanski kreolskimađarski" + @@ -20265,7 +20265,7 @@ const hrLangStr string = "" + // Size: 4673 bytes "skibuginskibulublinmedumbacaddokaripskicayugaatsamcebuanochigačibčačagat" + "ajskichuukesemarijskichinook žargonchoctawchipewyančerokijskičejenskisor" + "anski kurdskikoptskikrimski turskisejšelski kreolskikašupskidakota jezik" + - "dargwataitadelavarskislavedogribdinkazarmadogridonjolužičkidualasrednjon" + + "dargwataitadelavarskisubordinatedogribdinkazarmadogridonjolužičkidualasrednjon" + "izozemskijola-fonyidyuladazagaembuefikstaroegipatskiekajukelamitskisredn" + "joengleskiewondofangfilipinskifonkajunski francuskisrednjofrancuskistaro" + "francuskisjevernofrizijskiistočnofrizijskifurlanskigagagauskigan kineski" + @@ -20719,7 +20719,7 @@ const idLangStr string = "" + // Size: 4042 bytes "uriBikolBiniBanjarKomSiksikaBrajBodoAkooseBuriatBugisBuluBlinMedumbaKado" + "KaribCayugaAtsamCebuanoKigaChibchaChagataiChuukeMariJargon ChinookKoktaw" + "ChipewyanCherokeeCheyenneKurdi SoraniKoptikTatar KrimeaSeselwa Kreol Pra" + - "ncisKashubiaDakotaDargwaTaitaDelawareSlaveDogribDinkaZarmaDogriSorbia Hi" + + "ncisKashubiaDakotaDargwaTaitaDelawareSubordinateDogribDinkaZarmaDogriSorbia Hi" + "lirDualaBelanda Abad PertengahanJola-FonyiDyulaDazagaEmbuEfikMesir KunoE" + "kajukElamInggris Abad PertengahanEwondoFangFilipinoFonPrancis CajunPranc" + "is Abad PertengahanPrancis KunoArpitanFrisia UtaraFrisia TimurFriuliGaGa" + @@ -21021,7 +21021,7 @@ const itLangStr string = "" + // Size: 5065 bytes "bishnupriyabakhtiaribrajbrahuibodoakooseburiatbugibulublinmedumbacaddoca" + "ribicocayugaatsamcebuanochigachibchaciagataicochuukesemarigergo chinookc" + "hoctawchipewyancherokeecheyennecurdo soranicoptocapiznonturco crimeocreo" + - "lo delle Seychelleskashubiandakotadargwataitadelawareslavedogribdincazar" + + "lo delle Seychelleskashubiandakotadargwataitadelawaresubordinatedogribdincazar" + "madogribasso sorabodusun centraledualaolandese mediojola-fonydiuladazaga" + "embuefikemilianoegiziano anticoekajukaelamiticoinglese medioyupik centra" + "leewondoestremegnofangfilippinofinlandese del Tornedalenfonfrancese caju" + @@ -22337,7 +22337,7 @@ const ltLangStr string = "" + // Size: 5975 bytes "ibandžarųkomųsiksikųbišnuprijosbakhtiaribrajųbrahujųbodoakūsųburiatųbugi" + "nezųbulublinmedumbųkadokaribųkaijūgųatsamųsebuanųčigųčibčųčagatųčukesųma" + "riųčinuk žargonasčoktaučipvėjųčerokiųčajenųsoranių kurdųkoptųcapiznonKry" + - "mo turkųSeišelių kreolų ir prancūzųkašubųdakotųdargvataitųdelaveroslaved" + + "mo turkųSeišelių kreolų ir prancūzųkašubųdakotųdargvataitųdelaverosubordinated" + "ogribųdinkųzarmųdogrižemutinių sorbųcentrinio DusunodualųVidurio Vokieti" + "josdžiola-fonidyulųdazagųembuefikitalų kalbos Emilijos tarmėsenovės egip" + "tiečiųekajukelamitųVidurio Anglijoscentrinės Aliaskos jupikųevondoispanų" + @@ -23689,7 +23689,7 @@ const nlLangStr string = "" + // Size: 4765 bytes "huiBodoAkooseBoerjatischBugineesBuluBlinMedumbaCaddoCaribischCayugaAtsam" + "CebuanoChigaChibchaChagataiChuukeesMariChinook JargonChoctawChipewyanChe" + "rokeeCheyenneSoranîKoptischCapiznonKrim-TataarsSeychellencreoolsKasjoebi" + - "schDakotaDargwaTaitaDelawareSlaveyDogribDinkaZarmaDogriNedersorbischDusu" + + "schDakotaDargwaTaitaDelawareSubordinateyDogribDinkaZarmaDogriNedersorbischDusu" + "nDualaMiddelnederlandsJola-FonyiDyulaDazagaEmbuEfikEmilianoOudegyptischE" + "kajukElamitischMiddelengelsYupikEwondoExtremeensFangFilipijnsTornedal-Fi" + "nsFonCajun-FransMiddelfransOudfransArpitaansNoord-FriesOost-FriesFriulis" + @@ -23846,7 +23846,7 @@ const noLangStr string = "" + // Size: 4856 bytes "nibanjarkomsiksikabishnupriyabakhtiaribrajbrahuibodoakoseburjatiskbugine" + "siskbulublinmedumbacaddokaribiskcayugaatsamcebuanskkigachibchatsjagataic" + "huukesiskmarichinookchoctawchipewianskcherokesiskcheyennekurdisk (sorani" + - ")koptiskkapizkrimtatariskseselwakasjubiskdakotadargwataitadelawareslavey" + + ")koptiskkapizkrimtatariskseselwakasjubiskdakotadargwataitadelawaresubordinatey" + "dogribdinkazarmadogrilavsorbisksentraldusundualamellomnederlandskjola-fo" + "nyidyuladazagakiembuefikemilianskgammelegyptiskekajukelamittiskmellomeng" + "elsksentralyupikewondoekstremaduranskfangfilipinotornedalsfinskfoncajunf" + @@ -24141,7 +24141,7 @@ const plLangStr string = "" + // Size: 5587 bytes "bradźbrahuibodoakooseburiackibugijskibulublinmedumbakaddokaraibskikajuga" + "atsamcebuanochigaczibczaczagatajskichuukmaryjskiżargon czinuckiczoktawsk" + "iczipewiańskiczirokeskiczejeńskisoranikoptyjskicapiznonkrymskotatarskikr" + - "eolski seszelskikaszubskidakotadargwijskitaitadelawareslavedogribdinkadż" + + "eolski seszelskikaszubskidakotadargwijskitaitadelawaresubordinatedogribdinkadż" + "ermadogridolnołużyckidusun centralnydualaśredniowieczny niderlandzkidiol" + "adiuladazagaembuefikemilijskistaroegipskiekajukelamickiśrednioangielskiy" + "upik środkowosyberyjskiewondoestremadurskifangfilipinomeänkielifoncajuńs" + @@ -24559,7 +24559,7 @@ const roLangStr string = "" + // Size: 4259 bytes "seburiatbuginezăbulublinmedumbacaddocaribcayugaatsamcebuanăchigachibchac" + "hagataichuukesemarijargon chinookchoctawchipewyancherokeecheyennekurdă c" + "entralăcoptăturcă crimeeanăcreolă franceză seselwacașubianădakotadargwat" + - "aitadelawareslavedogribdinkazarmadogrisorabă de josdualaneerlandeză medi" + + "aitadelawaresubordinatedogribdinkazarmadogrisorabă de josdualaneerlandeză medi" + "ejola-fonyidyuladazagaembuefikegipteană vecheekajukelamităengleză mediee" + "wondofangfilipinezăfonfranceză cajunfranceză mediefranceză vechefrizonă " + "nordicăfrizonă orientalăfriulanăgagăgăuzăchineză gangayogbayageezgilbert" + @@ -25181,7 +25181,7 @@ const slLangStr string = "" + // Size: 6475 bytes "akadoščinakaribski jeziksebuanščinačigajščinačibčevščinačagatajščinatruk" + "eščinamarijščinačinuški žargončoktavščinačipevščinačerokeščinačejenščina" + "soranska kurdščinakoptščinakrimska tatarščinasejšelska francoska kreolšč" + - "inakašubščinadakotščinadarginščinataitajščinadelavarščinaslavejščinadogr" + + "inakašubščinadakotščinadarginščinataitajščinadelavarščinasubordinatejščinadogr" + "ibdinkazarmajščinadogridolnja lužiška srbščinadualasrednja nizozemščinaj" + "ola-fonjiščinadiuladazagaembujščinaefiščinastara egipčanščinaekajukelamš" + "činasrednja angleščinaevondovščinafangijščinafilipinščinafonščinacajuns" + @@ -25801,7 +25801,7 @@ const svLangStr string = "" + // Size: 5493 bytes "bodobakossiburjätiskabuginesiskabouloublinbagangtecaddokaribiskacayugaat" + "samcebuanochigachibchachagataichuukesiskamariskachinookchoctawchipewyanc" + "herokesiskacheyennesoranisk kurdiskakoptiskakapisnonkrimtatariskaseychel" + - "lisk kreolkasjubiskadakotadarginskataitadelawareslavejdogribdinkazarmado" + + "lisk kreolkasjubiskadakotadarginskataitadelawaresubordinatejdogribdinkazarmado" + "grilågsorbiskacentraldusundualamedelnederländskajola-fonyidyuladazagaemb" + "uefikemiliskafornegyptiskaekajukelamitiskamedelengelskacentralalaskisk j" + "upiskaewondoextremaduriskafangfilippinskameänkielifonspråketcajun-fransk" + @@ -26585,7 +26585,7 @@ const trLangStr string = "" + // Size: 5998 bytes "uryatçaBugisBuluBlinMedumbaKado diliCaribKayuga diliAtsamSebuano diliKig" + "acaÇibça diliÇağataycaChuukeseMari diliÇinuk diliÇoktav diliÇipevya dili" + "ÇerokiceŞayenceOrta KürtçeKıpticeCapiznonKırım TürkçesiSeselwa Kreole F" + - "ransızcasıKashubianDakotacaDarginceTaitaDelawareSlavey diliDogribDinka d" + + "ransızcasıKashubianDakotacaDarginceTaitaDelawareSubordinatey diliDogribDinka d" + "iliZarmaDogriAşağı SorbçaOrta KadazanDualaOrtaçağ FelemenkçesiJola-Fonyi" + "DyulaDazagaEmbuEfikEmilia DiliEski Mısır DiliEkajukElamOrtaçağ İngilizce" + "siMerkezi YupikçeEwondoEkstremadura DiliFangFilipinceTornedalin FincesiF" + @@ -27195,7 +27195,7 @@ const viLangStr string = "" + // Size: 8700 bytes " ChagataiTiếng ChuukTiếng MariBiệt ngữ ChinookTiếng ChoctawTiếng Chipewy" + "anTiếng CherokeeTiếng CheyenneTiếng Kurd Miền TrungTiếng CopticTiếng Cap" + "iznonTiếng Thổ Nhĩ Kỳ CrimeanTiếng Pháp Seselwa CreoleTiếng KashubiaTiến" + - "g DakotaTiếng DargwaTiếng TaitaTiếng DelawareTiếng SlaveTiếng DogribTiến" + + "g DakotaTiếng DargwaTiếng TaitaTiếng DelawareTiếng SubordinateTiếng DogribTiến" + "g DinkaTiếng ZarmaTiếng DogriTiếng Hạ SorbiaTiếng Dusun Miền TrungTiếng " + "DualaTiếng Hà Lan Trung cổTiếng Jola-FonyiTiếng DyulaTiếng DazagaTiếng E" + "mbuTiếng EfikTiếng EmiliaTiếng Ai Cập cổTiếng EkajukTiếng ElamiteTiếng A" + @@ -31720,7 +31720,7 @@ const hrScriptStr string = "" + // Size: 2397 bytes "ijsko pismobamum pismobassa vah pismobatak pismobengalsko pismoblissymbo" + "lsbopomofo pismobrahmi pismobrajicabuginsko pismobuhid pismochakma pismo" + "unificirani kanadski aboriđinski slogovikarijsko pismočamsko pismočeroki" + - " pismocirth pismokoptsko pismocypriot pismoćirilicastaroslavenska crkven" + + " pismocirth pismokoptsko pismocypriot pismoćirilicastarosubordinatenska crkven" + "a čirilicadevangari pismodeseret pismoegipatsko narodno pismoegipatsko h" + "ijeratsko pismoegipatski hijeroglifietiopsko pismogruzijsko khutsuri pis" + "mogruzijsko pismoglagoljicagotičko pismograntha pismogrčko pismogudžarat" + diff --git a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/auth.go b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/auth.go index 9db07c0079..ca774cb45e 100644 --- a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/auth.go +++ b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/auth.go @@ -90,7 +90,7 @@ type saslResult struct { } type saslMechNegotation struct { - IsMaster int `bson:"ismaster"` + IsMain int `bson:"ismain"` SaslSupportedMechs string `bson:"saslSupportedMechs"` } @@ -236,7 +236,7 @@ func (socket *mongoSocket) Login(cred Credential) error { func (socket *mongoSocket) negotiateDefaultMech(cred Credential) (string, error) { user := cred.Source + "." + cred.Username - req := &saslMechNegotation{IsMaster: 1, SaslSupportedMechs: user} + req := &saslMechNegotation{IsMain: 1, SaslSupportedMechs: user} res := saslMechResult{} err := socket.loginRun(cred.Source, &req, &res, func() error { if !res.Ok { diff --git a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/auth_test.go b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/auth_test.go index 60908a8a58..aae2260d52 100644 --- a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/auth_test.go +++ b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/auth_test.go @@ -822,7 +822,7 @@ func (s *S) TestDefaultDatabase(c *C) { } func (s *S) TestAuthDirect(c *C) { - // Direct connections must work to the master and slaves. + // Direct connections must work to the main and subordinates. for _, port := range []string{"40031", "40032", "40033"} { url := fmt.Sprintf("mongodb://root:rapadura@localhost:%s/?connect=direct", port) session, err := mgo.Dial(url) @@ -838,7 +838,7 @@ func (s *S) TestAuthDirect(c *C) { } func (s *S) TestAuthDirectWithLogin(c *C) { - // Direct connections must work to the master and slaves. + // Direct connections must work to the main and subordinates. for _, port := range []string{"40031", "40032", "40033"} { url := fmt.Sprintf("mongodb://localhost:%s/?connect=direct", port) session, err := mgo.Dial(url) diff --git a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/cluster.go b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/cluster.go index c3bf8b0137..370c3d1a6d 100644 --- a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/cluster.go +++ b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/cluster.go @@ -51,7 +51,7 @@ type mongoCluster struct { userSeeds []string dynaSeeds []string servers mongoServers - masters mongoServers + mains mongoServers references int syncing bool direct bool @@ -118,7 +118,7 @@ func (cluster *mongoCluster) LiveServers() (servers []string) { func (cluster *mongoCluster) removeServer(server *mongoServer) { cluster.Lock() - cluster.masters.Remove(server) + cluster.mains.Remove(server) other := cluster.servers.Remove(server) cluster.Unlock() if other != nil { @@ -128,8 +128,8 @@ func (cluster *mongoCluster) removeServer(server *mongoServer) { server.Close() } -type isMasterResult struct { - IsMaster bool +type isMainResult struct { + IsMain bool Secondary bool Primary string Hosts []string @@ -140,11 +140,11 @@ type isMasterResult struct { MaxWireVersion int `bson:"maxWireVersion"` } -func (cluster *mongoCluster) isMaster(socket *mongoSocket, result *isMasterResult) error { - // Monotonic let's it talk to a slave and still hold the socket. +func (cluster *mongoCluster) isMain(socket *mongoSocket, result *isMainResult) error { + // Monotonic let's it talk to a subordinate and still hold the socket. session := newSession(Monotonic, cluster, 10*time.Second) session.setSocket(socket) - err := session.Run("ismaster", result) + err := session.Run("ismain", result) session.Close() return err } @@ -170,7 +170,7 @@ func (cluster *mongoCluster) syncServer(server *mongoServer) (info *mongoServerI log("SYNC Processing ", addr, "...") // Retry a few times to avoid knocking a server down for a hiccup. - var result isMasterResult + var result isMainResult var tryerr error for retry := 0; ; retry++ { if retry == 3 || retry == 1 && cluster.failFast { @@ -193,14 +193,14 @@ func (cluster *mongoCluster) syncServer(server *mongoServer) (info *mongoServerI logf("SYNC Failed to get socket to %s: %v", addr, err) continue } - err = cluster.isMaster(socket, &result) + err = cluster.isMain(socket, &result) socket.Release() if err != nil { tryerr = err - logf("SYNC Command 'ismaster' to %s failed: %v", addr, err) + logf("SYNC Command 'ismain' to %s failed: %v", addr, err) continue } - debugf("SYNC Result of 'ismaster' from %s: %#v", addr, result) + debugf("SYNC Result of 'ismain' from %s: %#v", addr, result) break } @@ -209,25 +209,25 @@ func (cluster *mongoCluster) syncServer(server *mongoServer) (info *mongoServerI return nil, nil, fmt.Errorf("server %s is not a member of replica set %q", addr, cluster.setName) } - if result.IsMaster { - debugf("SYNC %s is a master.", addr) - if !server.info.Master { + if result.IsMain { + debugf("SYNC %s is a main.", addr) + if !server.info.Main { // Made an incorrect assumption above, so fix stats. stats.conn(-1, false) stats.conn(+1, true) } } else if result.Secondary { - debugf("SYNC %s is a slave.", addr) + debugf("SYNC %s is a subordinate.", addr) } else if cluster.direct { - logf("SYNC %s in unknown state. Pretending it's a slave due to direct connection.", addr) + logf("SYNC %s in unknown state. Pretending it's a subordinate due to direct connection.", addr) } else { - logf("SYNC %s is neither a master nor a slave.", addr) + logf("SYNC %s is neither a main nor a subordinate.", addr) // Let stats track it as whatever was known before. - return nil, nil, errors.New(addr + " is not a master nor slave") + return nil, nil, errors.New(addr + " is not a main nor subordinate") } info = &mongoServerInfo{ - Master: result.IsMaster, + Main: result.IsMain, Mongos: result.Msg == "isdbgrid", Tags: result.Tags, SetName: result.SetName, @@ -236,7 +236,7 @@ func (cluster *mongoCluster) syncServer(server *mongoServer) (info *mongoServerI hosts = make([]string, 0, 1+len(result.Hosts)+len(result.Passives)) if result.Primary != "" { - // First in the list to speed up master discovery. + // First in the list to speed up main discovery. hosts = append(hosts, result.Primary) } hosts = append(hosts, result.Hosts...) @@ -264,23 +264,23 @@ func (cluster *mongoCluster) addServer(server *mongoServer, info *mongoServerInf return } cluster.servers.Add(server) - if info.Master { - cluster.masters.Add(server) - log("SYNC Adding ", server.Addr, " to cluster as a master.") + if info.Main { + cluster.mains.Add(server) + log("SYNC Adding ", server.Addr, " to cluster as a main.") } else { - log("SYNC Adding ", server.Addr, " to cluster as a slave.") + log("SYNC Adding ", server.Addr, " to cluster as a subordinate.") } } else { if server != current { panic("addServer attempting to add duplicated server") } - if server.Info().Master != info.Master { - if info.Master { - log("SYNC Server ", server.Addr, " is now a master.") - cluster.masters.Add(server) + if server.Info().Main != info.Main { + if info.Main { + log("SYNC Server ", server.Addr, " is now a main.") + cluster.mains.Add(server) } else { - log("SYNC Server ", server.Addr, " is now a slave.") - cluster.masters.Remove(server) + log("SYNC Server ", server.Addr, " is now a subordinate.") + cluster.mains.Remove(server) } } } @@ -378,11 +378,11 @@ func (cluster *mongoCluster) syncServersLoop() { // restart syncing if they wish to. cluster.serverSynced.Broadcast() // Check if we have to restart immediately either way. - restart := !direct && cluster.masters.Empty() || cluster.servers.Empty() + restart := !direct && cluster.mains.Empty() || cluster.servers.Empty() cluster.Unlock() if restart { - log("SYNC No masters found. Will synchronize again.") + log("SYNC No mains found. Will synchronize again.") time.Sleep(syncShortDelay) continue } @@ -484,8 +484,8 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { seen := make(map[string]bool) syncKind := partialSync - var spawnSync func(addr string, byMaster bool) - spawnSync = func(addr string, byMaster bool) { + var spawnSync func(addr string, byMain bool) + spawnSync = func(addr string, byMain bool) { wg.Add(1) go func() { defer wg.Done() @@ -498,7 +498,7 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { resolvedAddr := tcpaddr.String() m.Lock() - if byMaster { + if byMain { if pending, ok := notYetAdded[resolvedAddr]; ok { delete(notYetAdded, resolvedAddr) m.Unlock() @@ -522,7 +522,7 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { } m.Lock() - add := direct || info.Master || addIfFound[resolvedAddr] + add := direct || info.Main || addIfFound[resolvedAddr] if add { syncKind = completeSync } else { @@ -534,7 +534,7 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { } if !direct { for _, addr := range hosts { - spawnSync(addr, info.Master) + spawnSync(addr, info.Main) } } }() @@ -559,8 +559,8 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { } cluster.Lock() - mastersLen := cluster.masters.Len() - logf("SYNC Synchronization completed: %d master(s) and %d slave(s) alive.", mastersLen, cluster.servers.Len()-mastersLen) + mainsLen := cluster.mains.Len() + logf("SYNC Synchronization completed: %d main(s) and %d subordinate(s) alive.", mainsLen, cluster.servers.Len()-mainsLen) // Update dynamic seeds, but only if we have any good servers. Otherwise, // leave them alone for better chances of a successful sync in the future. @@ -575,23 +575,23 @@ func (cluster *mongoCluster) syncServersIteration(direct bool) { cluster.Unlock() } -// AcquireSocket returns a socket to a server in the cluster. If slaveOk is -// true, it will attempt to return a socket to a slave server. If it is -// false, the socket will necessarily be to a master server. -func (cluster *mongoCluster) AcquireSocket(mode Mode, slaveOk bool, syncTimeout time.Duration, socketTimeout time.Duration, serverTags []bson.D, poolLimit int) (s *mongoSocket, err error) { +// AcquireSocket returns a socket to a server in the cluster. If subordinateOk is +// true, it will attempt to return a socket to a subordinate server. If it is +// false, the socket will necessarily be to a main server. +func (cluster *mongoCluster) AcquireSocket(mode Mode, subordinateOk bool, syncTimeout time.Duration, socketTimeout time.Duration, serverTags []bson.D, poolLimit int) (s *mongoSocket, err error) { var started time.Time var syncCount uint warnedLimit := false for { cluster.RLock() for { - mastersLen := cluster.masters.Len() - slavesLen := cluster.servers.Len() - mastersLen - debugf("Cluster has %d known masters and %d known slaves.", mastersLen, slavesLen) - if mastersLen > 0 && !(slaveOk && mode == Secondary) || slavesLen > 0 && slaveOk { + mainsLen := cluster.mains.Len() + subordinatesLen := cluster.servers.Len() - mainsLen + debugf("Cluster has %d known mains and %d known subordinates.", mainsLen, subordinatesLen) + if mainsLen > 0 && !(subordinateOk && mode == Secondary) || subordinatesLen > 0 && subordinateOk { break } - if mastersLen > 0 && mode == Secondary && cluster.masters.HasMongos() { + if mainsLen > 0 && mode == Secondary && cluster.mains.HasMongos() { break } if started.IsZero() { @@ -610,10 +610,10 @@ func (cluster *mongoCluster) AcquireSocket(mode Mode, slaveOk bool, syncTimeout } var server *mongoServer - if slaveOk { + if subordinateOk { server = cluster.servers.BestFit(mode, serverTags) } else { - server = cluster.masters.BestFit(mode, nil) + server = cluster.mains.BestFit(mode, nil) } cluster.RUnlock() @@ -637,11 +637,11 @@ func (cluster *mongoCluster) AcquireSocket(mode Mode, slaveOk bool, syncTimeout cluster.syncServers() continue } - if abended && !slaveOk { - var result isMasterResult - err := cluster.isMaster(s, &result) - if err != nil || !result.IsMaster { - logf("Cannot confirm server %s as master (%v)", server.Addr, err) + if abended && !subordinateOk { + var result isMainResult + err := cluster.isMain(s, &result) + if err != nil || !result.IsMain { + logf("Cannot confirm server %s as main (%v)", server.Addr, err) s.Release() cluster.syncServers() time.Sleep(100 * time.Millisecond) diff --git a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/cluster_test.go b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/cluster_test.go index a19a2320aa..594bbc4eff 100644 --- a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/cluster_test.go +++ b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/cluster_test.go @@ -67,7 +67,7 @@ func (s *S) TestNewSession(c *C) { // With New(), each session has its own socket now. stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 2) c.Assert(stats.SocketsInUse, Equals, 2) // Ensure query parameters were cloned. @@ -170,9 +170,9 @@ func (s *S) TestModeStrong(c *C) { result := M{} cmd := session.DB("admin").C("$cmd") - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, true) + c.Assert(result["ismain"], Equals, true) coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) @@ -185,8 +185,8 @@ func (s *S) TestModeStrong(c *C) { } stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 2) c.Assert(stats.SocketsInUse, Equals, 1) session.SetMode(mgo.Strong, true) @@ -196,8 +196,8 @@ func (s *S) TestModeStrong(c *C) { } func (s *S) TestModeMonotonic(c *C) { - // Must necessarily connect to a slave, otherwise the - // master connection will be available first. + // Must necessarily connect to a subordinate, otherwise the + // main connection will be available first. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() @@ -206,19 +206,19 @@ func (s *S) TestModeMonotonic(c *C) { c.Assert(session.Mode(), Equals, mgo.Monotonic) - var result struct{ IsMaster bool } + var result struct{ IsMain bool } cmd := session.DB("admin").C("$cmd") - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result.IsMaster, Equals, false) + c.Assert(result.IsMain, Equals, false) coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result.IsMaster, Equals, true) + c.Assert(result.IsMain, Equals, true) // Wait since the sync also uses sockets. for len(session.LiveServers()) != 3 { @@ -227,8 +227,8 @@ func (s *S) TestModeMonotonic(c *C) { } stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 2) c.Assert(stats.SocketsInUse, Equals, 2) session.SetMode(mgo.Monotonic, true) @@ -245,7 +245,7 @@ func (s *S) TestModeMonotonicAfterStrong(c *C) { c.Assert(err, IsNil) defer session.Close() - // Insert something to force a connection to the master. + // Insert something to force a connection to the main. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) @@ -258,37 +258,37 @@ func (s *S) TestModeMonotonicAfterStrong(c *C) { time.Sleep(5e8) } - // Master socket should still be reserved. + // Main socket should still be reserved. stats := mgo.GetStats() c.Assert(stats.SocketsInUse, Equals, 1) - // Confirm it's the master even though it's Monotonic by now. + // Confirm it's the main even though it's Monotonic by now. result := M{} cmd := session.DB("admin").C("$cmd") - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, true) + c.Assert(result["ismain"], Equals, true) } func (s *S) TestModeStrongAfterMonotonic(c *C) { // Test that shifting from Monotonic to Strong while - // using a slave socket will keep the socket reserved - // until the master socket is necessary, so that no + // using a subordinate socket will keep the socket reserved + // until the main socket is necessary, so that no // switch over occurs unless it's actually necessary. - // Must necessarily connect to a slave, otherwise the - // master connection will be available first. + // Must necessarily connect to a subordinate, otherwise the + // main connection will be available first. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() session.SetMode(mgo.Monotonic, false) - // Ensure we're talking to a slave, and reserve the socket. + // Ensure we're talking to a subordinate, and reserve the socket. result := M{} - err = session.Run("ismaster", &result) + err = session.Run("ismain", &result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, false) + c.Assert(result["ismain"], Equals, false) // Switch to a Strong session. session.SetMode(mgo.Strong, false) @@ -299,20 +299,20 @@ func (s *S) TestModeStrongAfterMonotonic(c *C) { time.Sleep(5e8) } - // Slave socket should still be reserved. + // Subordinate socket should still be reserved. stats := mgo.GetStats() c.Assert(stats.SocketsInUse, Equals, 1) - // But any operation will switch it to the master. + // But any operation will switch it to the main. result = M{} - err = session.Run("ismaster", &result) + err = session.Run("ismain", &result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, true) + c.Assert(result["ismain"], Equals, true) } func (s *S) TestModeMonotonicWriteOnIteration(c *C) { - // Must necessarily connect to a slave, otherwise the - // master connection will be available first. + // Must necessarily connect to a subordinate, otherwise the + // main connection will be available first. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() @@ -330,7 +330,7 @@ func (s *S) TestModeMonotonicWriteOnIteration(c *C) { c.Assert(err, IsNil) } - // Release master so we can grab a slave again. + // Release main so we can grab a subordinate again. session.Refresh() // Wait until synchronization is done. @@ -356,8 +356,8 @@ func (s *S) TestModeMonotonicWriteOnIteration(c *C) { } func (s *S) TestModeEventual(c *C) { - // Must necessarily connect to a slave, otherwise the - // master connection will be available first. + // Must necessarily connect to a subordinate, otherwise the + // main connection will be available first. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() @@ -367,18 +367,18 @@ func (s *S) TestModeEventual(c *C) { c.Assert(session.Mode(), Equals, mgo.Eventual) result := M{} - err = session.Run("ismaster", &result) + err = session.Run("ismain", &result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, false) + c.Assert(result["ismain"], Equals, false) coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) result = M{} - err = session.Run("ismaster", &result) + err = session.Run("ismain", &result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, false) + c.Assert(result["ismain"], Equals, false) // Wait since the sync also uses sockets. for len(session.LiveServers()) != 3 { @@ -387,8 +387,8 @@ func (s *S) TestModeEventual(c *C) { } stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 2) c.Assert(stats.SocketsInUse, Equals, 0) } @@ -400,7 +400,7 @@ func (s *S) TestModeEventualAfterStrong(c *C) { c.Assert(err, IsNil) defer session.Close() - // Insert something to force a connection to the master. + // Insert something to force a connection to the main. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) @@ -413,16 +413,16 @@ func (s *S) TestModeEventualAfterStrong(c *C) { time.Sleep(5e8) } - // Master socket should still be reserved. + // Main socket should still be reserved. stats := mgo.GetStats() c.Assert(stats.SocketsInUse, Equals, 1) - // Confirm it's the master even though it's Eventual by now. + // Confirm it's the main even though it's Eventual by now. result := M{} cmd := session.DB("admin").C("$cmd") - err = cmd.Find(M{"ismaster": 1}).One(&result) + err = cmd.Find(M{"ismain": 1}).One(&result) c.Assert(err, IsNil) - c.Assert(result["ismaster"], Equals, true) + c.Assert(result["ismain"], Equals, true) session.SetMode(mgo.Eventual, true) @@ -439,12 +439,12 @@ func (s *S) TestModeStrongFallover(c *C) { c.Assert(err, IsNil) defer session.Close() - // With strong consistency, this will open a socket to the master. + // With strong consistency, this will open a socket to the main. result := &struct{ Host string }{} err = session.Run("serverStatus", result) c.Assert(err, IsNil) - // Kill the master. + // Kill the main. host := result.Host s.Stop(host) @@ -458,7 +458,7 @@ func (s *S) TestModeStrongFallover(c *C) { session.Refresh() - // Now we should be able to talk to the new master. + // Now we should be able to talk to the new main. // Increase the timeout since this may take quite a while. session.SetSyncTimeout(3 * time.Minute) @@ -466,7 +466,7 @@ func (s *S) TestModeStrongFallover(c *C) { c.Assert(err, IsNil) c.Assert(result.Host, Not(Equals), host) - // Insert some data to confirm it's indeed a master. + // Insert some data to confirm it's indeed a main. err = session.DB("mydb").C("mycoll").Insert(M{"n": 42}) c.Assert(err, IsNil) } @@ -480,13 +480,13 @@ func (s *S) TestModePrimaryHiccup(c *C) { c.Assert(err, IsNil) defer session.Close() - // With strong consistency, this will open a socket to the master. + // With strong consistency, this will open a socket to the main. result := &struct{ Host string }{} err = session.Run("serverStatus", result) c.Assert(err, IsNil) // Establish a few extra sessions to create spare sockets to - // the master. This increases a bit the chances of getting an + // the main. This increases a bit the chances of getting an // incorrect cached socket. var sessions []*mgo.Session for i := 0; i < 20; i++ { @@ -498,7 +498,7 @@ func (s *S) TestModePrimaryHiccup(c *C) { sessions[i].Close() } - // Kill the master, but bring it back immediatelly. + // Kill the main, but bring it back immediatelly. host := result.Host s.Stop(host) s.StartAll() @@ -513,11 +513,11 @@ func (s *S) TestModePrimaryHiccup(c *C) { session.Refresh() - // Now we should be able to talk to the new master. + // Now we should be able to talk to the new main. // Increase the timeout since this may take quite a while. session.SetSyncTimeout(3 * time.Minute) - // Insert some data to confirm it's indeed a master. + // Insert some data to confirm it's indeed a main. err = session.DB("mydb").C("mycoll").Insert(M{"n": 42}) c.Assert(err, IsNil) } @@ -533,19 +533,19 @@ func (s *S) TestModeMonotonicFallover(c *C) { session.SetMode(mgo.Monotonic, true) - // Insert something to force a switch to the master. + // Insert something to force a switch to the main. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - // Wait a bit for this to be synchronized to slaves. + // Wait a bit for this to be synchronized to subordinates. time.Sleep(3 * time.Second) result := &struct{ Host string }{} err = session.Run("serverStatus", result) c.Assert(err, IsNil) - // Kill the master. + // Kill the main. host := result.Host s.Stop(host) // Wait a bit for this to be take effect as recent servers do some cleanup @@ -562,13 +562,13 @@ func (s *S) TestModeMonotonicFallover(c *C) { session.Refresh() - // Now we should be able to talk to the new master. + // Now we should be able to talk to the new main. err = session.Run("serverStatus", result) c.Assert(err, IsNil) c.Assert(result.Host, Not(Equals), host) } -func (s *S) TestModeMonotonicWithSlaveFallover(c *C) { +func (s *S) TestModeMonotonicWithSubordinateFallover(c *C) { if *fast { c.Skip("-fast") } @@ -578,19 +578,19 @@ func (s *S) TestModeMonotonicWithSlaveFallover(c *C) { defer session.Close() ssresult := &struct{ Host string }{} - imresult := &struct{ IsMaster bool }{} + imresult := &struct{ IsMain bool }{} - // Figure the master while still using the strong session. + // Figure the main while still using the strong session. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - master := ssresult.Host - c.Assert(imresult.IsMaster, Equals, true, Commentf("%s is not the master", master)) + main := ssresult.Host + c.Assert(imresult.IsMain, Equals, true, Commentf("%s is not the main", main)) // Create new monotonic session with an explicit address to ensure - // a slave is synchronized before the master, otherwise a connection - // with the master may be used below for lack of other options. + // a subordinate is synchronized before the main, otherwise a connection + // with the main may be used below for lack of other options. var addr string switch { case strings.HasSuffix(ssresult.Host, ":40021"): @@ -610,41 +610,41 @@ func (s *S) TestModeMonotonicWithSlaveFallover(c *C) { session.SetMode(mgo.Monotonic, true) // Check the address of the socket associated with the monotonic session. - c.Log("Running serverStatus and isMaster with monotonic session") + c.Log("Running serverStatus and isMain with monotonic session") err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - slave := ssresult.Host - c.Assert(imresult.IsMaster, Equals, false, Commentf("%s is not a slave", slave)) + subordinate := ssresult.Host + c.Assert(imresult.IsMain, Equals, false, Commentf("%s is not a subordinate", subordinate)) - c.Assert(master, Not(Equals), slave) + c.Assert(main, Not(Equals), subordinate) - // Kill the master. - s.Stop(master) + // Kill the main. + s.Stop(main) - // Session must still be good, since we were talking to a slave. + // Session must still be good, since we were talking to a subordinate. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - c.Assert(ssresult.Host, Equals, slave, - Commentf("Monotonic session moved from %s to %s", slave, ssresult.Host)) + c.Assert(ssresult.Host, Equals, subordinate, + Commentf("Monotonic session moved from %s to %s", subordinate, ssresult.Host)) // If we try to insert something, it'll have to hold until the new - // master is available to move the connection, and work correctly. + // main is available to move the connection, and work correctly. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - // Must now be talking to the new master. + // Must now be talking to the new main. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - c.Assert(imresult.IsMaster, Equals, true, Commentf("%s is not the master", master)) + c.Assert(imresult.IsMain, Equals, true, Commentf("%s is not the main", main)) // ... which is not the old one, since it's still dead. - c.Assert(ssresult.Host, Not(Equals), master) + c.Assert(ssresult.Host, Not(Equals), main) } func (s *S) TestModeEventualFallover(c *C) { @@ -659,29 +659,29 @@ func (s *S) TestModeEventualFallover(c *C) { result := &struct{ Host string }{} err = session.Run("serverStatus", result) c.Assert(err, IsNil) - master := result.Host + main := result.Host session.SetMode(mgo.Eventual, true) - // Should connect to the master when needed. + // Should connect to the main when needed. coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - // Wait a bit for this to be synchronized to slaves. + // Wait a bit for this to be synchronized to subordinates. time.Sleep(3 * time.Second) - // Kill the master. - s.Stop(master) + // Kill the main. + s.Stop(main) - // Should still work, with the new master now. + // Should still work, with the new main now. coll = session.DB("mydb").C("mycoll") err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) err = session.Run("serverStatus", result) c.Assert(err, IsNil) - c.Assert(result.Host, Not(Equals), master) + c.Assert(result.Host, Not(Equals), main) } func (s *S) TestModeSecondaryJustPrimary(c *C) { @@ -743,7 +743,7 @@ func (s *S) TestModeSecondaryPreferredFallover(c *C) { err = coll.Insert(M{"a": 1}) c.Assert(err, IsNil) - // Wait a bit for this to be synchronized to slaves. + // Wait a bit for this to be synchronized to subordinates. time.Sleep(3 * time.Second) // Kill the primary. @@ -888,7 +888,7 @@ func (s *S) TestPreserveSocketCountOnSync(c *C) { c.Assert(stats.SocketsAlive, Equals, 3) - // Kill the master (with rs1, 'a' is always the master). + // Kill the main (with rs1, 'a' is always the main). s.Stop("localhost:40011") // Wait for the logic to run for a bit and bring it back. @@ -927,10 +927,10 @@ func (s *S) TestPreserveSocketCountOnSync(c *C) { c.Assert(stats.SocketRefs, Equals, 1) } -// Connect to the master of a deployment with a single server, +// Connect to the main of a deployment with a single server, // run an insert, and then ensure the insert worked and that a // single connection was established. -func (s *S) TestTopologySyncWithSingleMaster(c *C) { +func (s *S) TestTopologySyncWithSingleMain(c *C) { // Use hostname here rather than IP, to make things trickier. session, err := mgo.Dial("localhost:40001") c.Assert(err, IsNil) @@ -940,11 +940,11 @@ func (s *S) TestTopologySyncWithSingleMaster(c *C) { err = coll.Insert(M{"a": 1, "b": 2}) c.Assert(err, IsNil) - // One connection used for discovery. Master socket recycled for + // One connection used for discovery. Main socket recycled for // insert. Socket is reserved after insert. stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 0) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 0) c.Assert(stats.SocketsInUse, Equals, 1) // Refresh session and socket must be released. @@ -953,9 +953,9 @@ func (s *S) TestTopologySyncWithSingleMaster(c *C) { c.Assert(stats.SocketsInUse, Equals, 0) } -func (s *S) TestTopologySyncWithSlaveSeed(c *C) { - // That's supposed to be a slave. Must run discovery - // and find out master to insert successfully. +func (s *S) TestTopologySyncWithSubordinateSeed(c *C) { + // That's supposed to be a subordinate. Must run discovery + // and find out main to insert successfully. session, err := mgo.Dial("localhost:40012") c.Assert(err, IsNil) defer session.Close() @@ -968,13 +968,13 @@ func (s *S) TestTopologySyncWithSlaveSeed(c *C) { c.Assert(err, IsNil) c.Assert(result.Ok, Equals, true) - // One connection to each during discovery. Master + // One connection to each during discovery. Main // socket recycled for insert. stats := mgo.GetStats() - c.Assert(stats.MasterConns, Equals, 1) - c.Assert(stats.SlaveConns, Equals, 2) + c.Assert(stats.MainConns, Equals, 1) + c.Assert(stats.SubordinateConns, Equals, 2) - // Only one socket reference alive, in the master socket owned + // Only one socket reference alive, in the main socket owned // by the above session. c.Assert(stats.SocketsInUse, Equals, 1) @@ -1163,7 +1163,7 @@ func (s *S) TestDirect(c *C) { c.Assert(err, IsNil) defer session.Close() - // We know that server is a slave. + // We know that server is a subordinate. session.SetMode(mgo.Monotonic, true) result := &struct{ Host string }{} @@ -1176,7 +1176,7 @@ func (s *S) TestDirect(c *C) { c.Assert(stats.SocketsInUse, Equals, 1) c.Assert(stats.SocketRefs, Equals, 1) - // We've got no master, so it'll timeout. + // We've got no main, so it'll timeout. session.SetSyncTimeout(5e8 * time.Nanosecond) coll := session.DB("mydb").C("mycoll") @@ -1214,14 +1214,14 @@ func (s *S) TestDirectToUnknownStateMember(c *C) { c.Assert(err, IsNil) c.Assert(strings.HasSuffix(result.Host, ":40041"), Equals, true) - // We've got no master, so it'll timeout. + // We've got no main, so it'll timeout. session.SetSyncTimeout(5e8 * time.Nanosecond) coll := session.DB("mydb").C("mycoll") err = coll.Insert(M{"test": 1}) c.Assert(err, ErrorMatches, "no reachable servers") - // Slave is still reachable. + // Subordinate is still reachable. result.Host = "" err = session.Run("serverStatus", result) c.Assert(err, IsNil) @@ -1281,21 +1281,21 @@ func (s *S) countCommands(c *C, server, commandName string) (n int) { return result.Metrics.Commands[commandName].Total } -func (s *S) TestMonotonicSlaveOkFlagWithMongos(c *C) { +func (s *S) TestMonotonicSubordinateOkFlagWithMongos(c *C) { session, err := mgo.Dial("localhost:40021") c.Assert(err, IsNil) defer session.Close() ssresult := &struct{ Host string }{} - imresult := &struct{ IsMaster bool }{} + imresult := &struct{ IsMain bool }{} - // Figure the master while still using the strong session. + // Figure the main while still using the strong session. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - master := ssresult.Host - c.Assert(imresult.IsMaster, Equals, true, Commentf("%s is not the master", master)) + main := ssresult.Host + c.Assert(imresult.IsMain, Equals, true, Commentf("%s is not the main", main)) // Ensure mongos is aware about the current topology. s.Stop(":40201") @@ -1333,7 +1333,7 @@ func (s *S) TestMonotonicSlaveOkFlagWithMongos(c *C) { q22a := s.countQueries(c, "localhost:40022") q23a := s.countQueries(c, "localhost:40023") - // Do a SlaveOk query through MongoS + // Do a SubordinateOk query through MongoS mongos.SetMode(mgo.Monotonic, true) @@ -1350,23 +1350,23 @@ func (s *S) TestMonotonicSlaveOkFlagWithMongos(c *C) { q22b := s.countQueries(c, "localhost:40022") q23b := s.countQueries(c, "localhost:40023") - var masterDelta, slaveDelta int - switch hostPort(master) { + var mainDelta, subordinateDelta int + switch hostPort(main) { case "40021": - masterDelta = q21b - q21a - slaveDelta = (q22b - q22a) + (q23b - q23a) + mainDelta = q21b - q21a + subordinateDelta = (q22b - q22a) + (q23b - q23a) case "40022": - masterDelta = q22b - q22a - slaveDelta = (q21b - q21a) + (q23b - q23a) + mainDelta = q22b - q22a + subordinateDelta = (q21b - q21a) + (q23b - q23a) case "40023": - masterDelta = q23b - q23a - slaveDelta = (q21b - q21a) + (q22b - q22a) + mainDelta = q23b - q23a + subordinateDelta = (q21b - q21a) + (q22b - q22a) default: c.Fatal("Uh?") } - c.Check(masterDelta, Equals, 0) // Just the counting itself. - c.Check(slaveDelta, Equals, 5) // The counting for both, plus 5 queries above. + c.Check(mainDelta, Equals, 0) // Just the counting itself. + c.Check(subordinateDelta, Equals, 5) // The counting for both, plus 5 queries above. } func (s *S) TestSecondaryModeWithMongos(c *C) { @@ -1375,15 +1375,15 @@ func (s *S) TestSecondaryModeWithMongos(c *C) { defer session.Close() ssresult := &struct{ Host string }{} - imresult := &struct{ IsMaster bool }{} + imresult := &struct{ IsMain bool }{} - // Figure the master while still using the strong session. + // Figure the main while still using the strong session. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - master := ssresult.Host - c.Assert(imresult.IsMaster, Equals, true, Commentf("%s is not the master", master)) + main := ssresult.Host + c.Assert(imresult.IsMain, Equals, true, Commentf("%s is not the main", main)) // Ensure mongos is aware about the current topology. s.Stop(":40201") @@ -1440,23 +1440,23 @@ func (s *S) TestSecondaryModeWithMongos(c *C) { q22b := s.countQueries(c, "localhost:40022") q23b := s.countQueries(c, "localhost:40023") - var masterDelta, slaveDelta int - switch hostPort(master) { + var mainDelta, subordinateDelta int + switch hostPort(main) { case "40021": - masterDelta = q21b - q21a - slaveDelta = (q22b - q22a) + (q23b - q23a) + mainDelta = q21b - q21a + subordinateDelta = (q22b - q22a) + (q23b - q23a) case "40022": - masterDelta = q22b - q22a - slaveDelta = (q21b - q21a) + (q23b - q23a) + mainDelta = q22b - q22a + subordinateDelta = (q21b - q21a) + (q23b - q23a) case "40023": - masterDelta = q23b - q23a - slaveDelta = (q21b - q21a) + (q22b - q22a) + mainDelta = q23b - q23a + subordinateDelta = (q21b - q21a) + (q22b - q22a) default: c.Fatal("Uh?") } - c.Check(masterDelta, Equals, 0) // Just the counting itself. - c.Check(slaveDelta, Equals, 5) // The counting for both, plus 5 queries above. + c.Check(mainDelta, Equals, 0) // Just the counting itself. + c.Check(subordinateDelta, Equals, 5) // The counting for both, plus 5 queries above. } func (s *S) TestSecondaryModeWithMongosInsert(c *C) { @@ -1490,31 +1490,31 @@ func (s *S) TestRemovalOfClusterMember(c *C) { c.Skip("-fast") } - master, err := mgo.Dial("localhost:40021") + main, err := mgo.Dial("localhost:40021") c.Assert(err, IsNil) - defer master.Close() + defer main.Close() // Wait for cluster to fully sync up. for i := 0; i < 10; i++ { - if len(master.LiveServers()) == 3 { + if len(main.LiveServers()) == 3 { break } time.Sleep(5e8) } - if len(master.LiveServers()) != 3 { - c.Fatalf("Test started with bad cluster state: %v", master.LiveServers()) + if len(main.LiveServers()) != 3 { + c.Fatalf("Test started with bad cluster state: %v", main.LiveServers()) } result := &struct { - IsMaster bool + IsMain bool Me string }{} - slave := master.Copy() - slave.SetMode(mgo.Monotonic, true) // Monotonic can hold a non-master socket persistently. - err = slave.Run("isMaster", result) + subordinate := main.Copy() + subordinate.SetMode(mgo.Monotonic, true) // Monotonic can hold a non-main socket persistently. + err = subordinate.Run("isMain", result) c.Assert(err, IsNil) - c.Assert(result.IsMaster, Equals, false) - slaveAddr := result.Me + c.Assert(result.IsMain, Equals, false) + subordinateAddr := result.Me defer func() { config := map[string]string{ @@ -1522,10 +1522,10 @@ func (s *S) TestRemovalOfClusterMember(c *C) { "40022": `{_id: 2, host: "127.0.0.1:40022", priority: 0, tags: {rs2: "b"}}`, "40023": `{_id: 3, host: "127.0.0.1:40023", priority: 0, tags: {rs2: "c"}}`, } - master.Refresh() - master.Run(bson.D{{"$eval", `rs.add(` + config[hostPort(slaveAddr)] + `)`}}, nil) - master.Close() - slave.Close() + main.Refresh() + main.Run(bson.D{{"$eval", `rs.add(` + config[hostPort(subordinateAddr)] + `)`}}, nil) + main.Close() + subordinate.Close() // Ensure suite syncs up with the changes before next test. s.Stop(":40201") @@ -1536,29 +1536,29 @@ func (s *S) TestRemovalOfClusterMember(c *C) { // break due to their expectation of things being in a working state. }() - c.Logf("========== Removing slave: %s ==========", slaveAddr) + c.Logf("========== Removing subordinate: %s ==========", subordinateAddr) - master.Run(bson.D{{"$eval", `rs.remove("` + slaveAddr + `")`}}, nil) + main.Run(bson.D{{"$eval", `rs.remove("` + subordinateAddr + `")`}}, nil) - master.Refresh() + main.Refresh() - // Give the cluster a moment to catch up by doing a roundtrip to the master. - err = master.Ping() + // Give the cluster a moment to catch up by doing a roundtrip to the main. + err = main.Ping() c.Assert(err, IsNil) time.Sleep(3e9) - // This must fail since the slave has been taken off the cluster. - err = slave.Ping() + // This must fail since the subordinate has been taken off the cluster. + err = subordinate.Ping() c.Assert(err, NotNil) for i := 0; i < 15; i++ { - if len(master.LiveServers()) == 2 { + if len(main.LiveServers()) == 2 { break } time.Sleep(time.Second) } - live := master.LiveServers() + live := main.LiveServers() if len(live) != 2 { c.Errorf("Removed server still considered live: %#s", live) } @@ -1622,23 +1622,23 @@ func (s *S) TestPoolLimitMany(c *C) { const poolLimit = 64 session.SetPoolLimit(poolLimit) - // Consume the whole limit for the master. - var master []*mgo.Session + // Consume the whole limit for the main. + var main []*mgo.Session for i := 0; i < poolLimit; i++ { s := session.Copy() defer s.Close() c.Assert(s.Ping(), IsNil) - master = append(master, s) + main = append(main, s) } before := time.Now() go func() { time.Sleep(3e9) - master[0].Refresh() + main[0].Refresh() }() // Then, a single ping must block, since it would need another - // connection to the master, over the limit. Once the goroutine + // connection to the main, over the limit. Once the goroutine // above releases its socket, it should move on. session.Ping() delay := time.Now().Sub(before) @@ -1774,17 +1774,17 @@ func (s *S) TestPrimaryShutdownOnAuthShard(c *C) { err = coll.Insert(bson.M{"n": 1}) c.Assert(err, IsNil) - // Dial the replica set to figure the master out. + // Dial the replica set to figure the main out. rs, err := mgo.Dial("root:rapadura@localhost:40031") c.Assert(err, IsNil) defer rs.Close() - // With strong consistency, this will open a socket to the master. + // With strong consistency, this will open a socket to the main. result := &struct{ Host string }{} err = rs.Run("serverStatus", result) c.Assert(err, IsNil) - // Kill the master. + // Kill the main. host := result.Host s.Stop(host) @@ -1799,7 +1799,7 @@ func (s *S) TestPrimaryShutdownOnAuthShard(c *C) { if err == nil { break } - c.Logf("Waiting for replica set to elect a new master. Last error: %v", err) + c.Logf("Waiting for replica set to elect a new main. Last error: %v", err) time.Sleep(500 * time.Millisecond) } c.Assert(err, IsNil) @@ -1841,7 +1841,7 @@ func (s *S) TestNearestSecondary(c *C) { session.SetMode(mgo.Monotonic, true) var result struct{ Host string } - // See which slave picks the line, several times to avoid chance. + // See which subordinate picks the line, several times to avoid chance. for i := 0; i < 10; i++ { session.Refresh() err = session.Run("serverStatus", &result) @@ -1989,24 +1989,24 @@ func (s *S) TestSelectServersWithMongos(c *C) { defer session.Close() ssresult := &struct{ Host string }{} - imresult := &struct{ IsMaster bool }{} + imresult := &struct{ IsMain bool }{} - // Figure the master while still using the strong session. + // Figure the main while still using the strong session. err = session.Run("serverStatus", ssresult) c.Assert(err, IsNil) - err = session.Run("isMaster", imresult) + err = session.Run("isMain", imresult) c.Assert(err, IsNil) - master := ssresult.Host - c.Assert(imresult.IsMaster, Equals, true, Commentf("%s is not the master", master)) + main := ssresult.Host + c.Assert(imresult.IsMain, Equals, true, Commentf("%s is not the main", main)) - var slave1, slave2 string - switch hostPort(master) { + var subordinate1, subordinate2 string + switch hostPort(main) { case "40021": - slave1, slave2 = "b", "c" + subordinate1, subordinate2 = "b", "c" case "40022": - slave1, slave2 = "a", "c" + subordinate1, subordinate2 = "a", "c" case "40023": - slave1, slave2 = "a", "b" + subordinate1, subordinate2 = "a", "b" } // Collect op counters for everyone. @@ -2014,7 +2014,7 @@ func (s *S) TestSelectServersWithMongos(c *C) { q22a := s.countQueries(c, "localhost:40022") q23a := s.countQueries(c, "localhost:40023") - // Do a SlaveOk query through MongoS + // Do a SubordinateOk query through MongoS mongos, err := mgo.Dial("localhost:40202") c.Assert(err, IsNil) defer mongos.Close() @@ -2022,7 +2022,7 @@ func (s *S) TestSelectServersWithMongos(c *C) { mongos.SetMode(mgo.Monotonic, true) mongos.Refresh() - mongos.SelectServers(bson.D{{"rs2", slave1}}) + mongos.SelectServers(bson.D{{"rs2", subordinate1}}) coll := mongos.DB("mydb").C("mycoll") result := &struct{}{} for i := 0; i != 5; i++ { @@ -2031,7 +2031,7 @@ func (s *S) TestSelectServersWithMongos(c *C) { } mongos.Refresh() - mongos.SelectServers(bson.D{{"rs2", slave2}}) + mongos.SelectServers(bson.D{{"rs2", subordinate2}}) coll = mongos.DB("mydb").C("mycoll") for i := 0; i != 7; i++ { err := coll.Find(nil).One(result) @@ -2043,7 +2043,7 @@ func (s *S) TestSelectServersWithMongos(c *C) { q22b := s.countQueries(c, "localhost:40022") q23b := s.countQueries(c, "localhost:40023") - switch hostPort(master) { + switch hostPort(main) { case "40021": c.Check(q21b-q21a, Equals, 0) c.Check(q22b-q22a, Equals, 5) diff --git a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/server.go b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/server.go index 1cf5989066..54272c488b 100644 --- a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/server.go +++ b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/server.go @@ -68,7 +68,7 @@ func (dial dialer) isSet() bool { } type mongoServerInfo struct { - Master bool + Main bool Mongos bool Tags bson.D MaxWireVersion int @@ -152,7 +152,7 @@ func (server *mongoServer) AcquireSocket(poolLimit int, timeout time.Duration) ( // generally be done through server.AcquireSocket(). func (server *mongoServer) Connect(timeout time.Duration) (*mongoSocket, error) { server.RLock() - master := server.info.Master + main := server.info.Main dial := server.dial server.RUnlock() @@ -182,7 +182,7 @@ func (server *mongoServer) Connect(timeout time.Duration) (*mongoSocket, error) } logf("Connection to %s established.", server.Addr) - stats.conn(+1, master) + stats.conn(+1, main) return newSocket(server, conn, timeout), nil } @@ -299,7 +299,7 @@ func (server *mongoServer) pinger(loop bool) { op := queryOp{ collection: "admin.$cmd", query: bson.D{{"ping", 1}}, - flags: flagSlaveOk, + flags: flagSubordinateOk, limit: -1, } for { @@ -442,11 +442,11 @@ func (servers *mongoServers) BestFit(mode Mode, serverTags []bson.D) *mongoServe switch { case serverTags != nil && !next.info.Mongos && !next.hasTags(serverTags): // Must have requested tags. - case mode == Secondary && next.info.Master && !next.info.Mongos: + case mode == Secondary && next.info.Main && !next.info.Mongos: // Must be a secondary or mongos. - case next.info.Master != best.info.Master && mode != Nearest: - // Prefer slaves, unless the mode is PrimaryPreferred. - swap = (mode == PrimaryPreferred) != best.info.Master + case next.info.Main != best.info.Main && mode != Nearest: + // Prefer subordinates, unless the mode is PrimaryPreferred. + swap = (mode == PrimaryPreferred) != best.info.Main case absDuration(next.pingValue-best.pingValue) > 15*time.Millisecond: // Prefer nearest server. swap = next.pingValue < best.pingValue diff --git a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/session.go b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/session.go index 3e234f8318..ea6646c320 100644 --- a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/session.go +++ b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/session.go @@ -77,9 +77,9 @@ const ( type Session struct { m sync.RWMutex cluster_ *mongoCluster - slaveSocket *mongoSocket - masterSocket *mongoSocket - slaveOk bool + subordinateSocket *mongoSocket + mainSocket *mongoSocket + subordinateOk bool consistency Mode queryConfig query safeOp *queryOp @@ -634,11 +634,11 @@ func newSession(consistency Mode, cluster *mongoCluster, timeout time.Duration) func copySession(session *Session, keepCreds bool) (s *Session) { cluster := session.cluster() cluster.Acquire() - if session.masterSocket != nil { - session.masterSocket.Acquire() + if session.mainSocket != nil { + session.mainSocket.Acquire() } - if session.slaveSocket != nil { - session.slaveSocket.Acquire() + if session.subordinateSocket != nil { + session.subordinateSocket.Acquire() } var creds []Credential if keepCreds { @@ -850,11 +850,11 @@ func (db *Database) Logout() { } } if found { - if session.masterSocket != nil { - session.masterSocket.Logout(dbname) + if session.mainSocket != nil { + session.mainSocket.Logout(dbname) } - if session.slaveSocket != nil { - session.slaveSocket.Logout(dbname) + if session.subordinateSocket != nil { + session.subordinateSocket.Logout(dbname) } } session.m.Unlock() @@ -864,11 +864,11 @@ func (db *Database) Logout() { func (s *Session) LogoutAll() { s.m.Lock() for _, cred := range s.creds { - if s.masterSocket != nil { - s.masterSocket.Logout(cred.Source) + if s.mainSocket != nil { + s.mainSocket.Logout(cred.Source) } - if s.slaveSocket != nil { - s.slaveSocket.Logout(cred.Source) + if s.subordinateSocket != nil { + s.subordinateSocket.Logout(cred.Source) } } s.creds = s.creds[0:0] @@ -1031,9 +1031,9 @@ func isAuthError(err error) bool { return ok && e.Code == 13 } -func isNotMasterError(err error) bool { +func isNotMainError(err error) bool { e, ok := err.(*QueryError) - return ok && strings.Contains(e.Message, "not master") + return ok && strings.Contains(e.Message, "not main") } func (db *Database) runUserCmd(cmdName string, user *User) error { @@ -1754,7 +1754,7 @@ func (s *Session) cluster() *mongoCluster { // guarantees according to the current consistency setting for the session. func (s *Session) Refresh() { s.m.Lock() - s.slaveOk = s.consistency != Strong + s.subordinateOk = s.consistency != Strong s.unsetSocket() s.m.Unlock() } @@ -1803,15 +1803,15 @@ func (s *Session) Refresh() { // connection is unsuitable (to a secondary server in a Strong session). func (s *Session) SetMode(consistency Mode, refresh bool) { s.m.Lock() - debugf("Session %p: setting mode %d with refresh=%v (master=%p, slave=%p)", s, consistency, refresh, s.masterSocket, s.slaveSocket) + debugf("Session %p: setting mode %d with refresh=%v (main=%p, subordinate=%p)", s, consistency, refresh, s.mainSocket, s.subordinateSocket) s.consistency = consistency if refresh { - s.slaveOk = s.consistency != Strong + s.subordinateOk = s.consistency != Strong s.unsetSocket() } else if s.consistency == Strong { - s.slaveOk = false - } else if s.masterSocket == nil { - s.slaveOk = true + s.subordinateOk = false + } else if s.mainSocket == nil { + s.subordinateOk = true } s.m.Unlock() } @@ -1841,11 +1841,11 @@ func (s *Session) SetSyncTimeout(d time.Duration) { func (s *Session) SetSocketTimeout(d time.Duration) { s.m.Lock() s.sockTimeout = d - if s.masterSocket != nil { - s.masterSocket.SetTimeout(d) + if s.mainSocket != nil { + s.mainSocket.SetTimeout(d) } - if s.slaveSocket != nil { - s.slaveSocket.SetTimeout(d) + if s.subordinateSocket != nil { + s.subordinateSocket.SetTimeout(d) } s.m.Unlock() } @@ -2395,9 +2395,9 @@ func (c *Collection) NewIter(session *Session, firstBatch []bson.Raw, cursorId i var server *mongoServer csession := c.Database.Session csession.m.RLock() - socket := csession.masterSocket + socket := csession.mainSocket if socket == nil { - socket = csession.slaveSocket + socket = csession.subordinateSocket } if socket != nil { server = socket.Server() @@ -3698,8 +3698,8 @@ func (q *Query) Tail(timeout time.Duration) *Iter { func (s *Session) prepareQuery(op *queryOp) { s.m.RLock() op.mode = s.consistency - if s.slaveOk { - op.flags |= flagSlaveOk + if s.subordinateOk { + op.flags |= flagSubordinateOk } s.m.RUnlock() return @@ -4558,20 +4558,20 @@ func (s *Session) BuildInfo() (info BuildInfo, err error) { // --------------------------------------------------------------------------- // Internal session handling helpers. -func (s *Session) acquireSocket(slaveOk bool) (*mongoSocket, error) { +func (s *Session) acquireSocket(subordinateOk bool) (*mongoSocket, error) { // Read-only lock to check for previously reserved socket. s.m.RLock() - // If there is a slave socket reserved and its use is acceptable, take it as long - // as there isn't a master socket which would be preferred by the read preference mode. - if s.slaveSocket != nil && s.slaveOk && slaveOk && (s.masterSocket == nil || s.consistency != PrimaryPreferred && s.consistency != Monotonic) { - socket := s.slaveSocket + // If there is a subordinate socket reserved and its use is acceptable, take it as long + // as there isn't a main socket which would be preferred by the read preference mode. + if s.subordinateSocket != nil && s.subordinateOk && subordinateOk && (s.mainSocket == nil || s.consistency != PrimaryPreferred && s.consistency != Monotonic) { + socket := s.subordinateSocket socket.Acquire() s.m.RUnlock() return socket, nil } - if s.masterSocket != nil { - socket := s.masterSocket + if s.mainSocket != nil { + socket := s.mainSocket socket.Acquire() s.m.RUnlock() return socket, nil @@ -4583,17 +4583,17 @@ func (s *Session) acquireSocket(slaveOk bool) (*mongoSocket, error) { s.m.Lock() defer s.m.Unlock() - if s.slaveSocket != nil && s.slaveOk && slaveOk && (s.masterSocket == nil || s.consistency != PrimaryPreferred && s.consistency != Monotonic) { - s.slaveSocket.Acquire() - return s.slaveSocket, nil + if s.subordinateSocket != nil && s.subordinateOk && subordinateOk && (s.mainSocket == nil || s.consistency != PrimaryPreferred && s.consistency != Monotonic) { + s.subordinateSocket.Acquire() + return s.subordinateSocket, nil } - if s.masterSocket != nil { - s.masterSocket.Acquire() - return s.masterSocket, nil + if s.mainSocket != nil { + s.mainSocket.Acquire() + return s.mainSocket, nil } // Still not good. We need a new socket. - sock, err := s.cluster().AcquireSocket(s.consistency, slaveOk && s.slaveOk, s.syncTimeout, s.sockTimeout, s.queryConfig.op.serverTags, s.poolLimit) + sock, err := s.cluster().AcquireSocket(s.consistency, subordinateOk && s.subordinateOk, s.syncTimeout, s.sockTimeout, s.queryConfig.op.serverTags, s.poolLimit) if err != nil { return nil, err } @@ -4606,16 +4606,16 @@ func (s *Session) acquireSocket(slaveOk bool) (*mongoSocket, error) { // Keep track of the new socket, if necessary. // Note that, as a special case, if the Eventual session was - // not refreshed (s.slaveSocket != nil), it means the developer + // not refreshed (s.subordinateSocket != nil), it means the developer // asked to preserve an existing reserved socket, so we'll - // keep a master one around too before a Refresh happens. - if s.consistency != Eventual || s.slaveSocket != nil { + // keep a main one around too before a Refresh happens. + if s.consistency != Eventual || s.subordinateSocket != nil { s.setSocket(sock) } - // Switch over a Monotonic session to the master. - if !slaveOk && s.consistency == Monotonic { - s.slaveOk = false + // Switch over a Monotonic session to the main. + if !subordinateOk && s.consistency == Monotonic { + s.subordinateOk = false } return sock, nil @@ -4624,29 +4624,29 @@ func (s *Session) acquireSocket(slaveOk bool) (*mongoSocket, error) { // setSocket binds socket to this section. func (s *Session) setSocket(socket *mongoSocket) { info := socket.Acquire() - if info.Master { - if s.masterSocket != nil { - panic("setSocket(master) with existing master socket reserved") + if info.Main { + if s.mainSocket != nil { + panic("setSocket(main) with existing main socket reserved") } - s.masterSocket = socket + s.mainSocket = socket } else { - if s.slaveSocket != nil { - panic("setSocket(slave) with existing slave socket reserved") + if s.subordinateSocket != nil { + panic("setSocket(subordinate) with existing subordinate socket reserved") } - s.slaveSocket = socket + s.subordinateSocket = socket } } -// unsetSocket releases any slave and/or master sockets reserved. +// unsetSocket releases any subordinate and/or main sockets reserved. func (s *Session) unsetSocket() { - if s.masterSocket != nil { - s.masterSocket.Release() + if s.mainSocket != nil { + s.mainSocket.Release() } - if s.slaveSocket != nil { - s.slaveSocket.Release() + if s.subordinateSocket != nil { + s.subordinateSocket.Release() } - s.masterSocket = nil - s.slaveSocket = nil + s.mainSocket = nil + s.subordinateSocket = nil } func (iter *Iter) replyFunc() replyFunc { diff --git a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/session_test.go b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/session_test.go index b95d00eb36..891c8e72dd 100644 --- a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/session_test.go +++ b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/session_test.go @@ -2936,7 +2936,7 @@ func (s *S) TestSafeParameters(c *C) { // Tweak the safety parameters to something unachievable. session.SetSafe(&mgo.Safe{W: 4, WTimeout: 100}) err = coll.Insert(M{"_id": 1}) - c.Assert(err, ErrorMatches, "timeout|timed out waiting for slaves|Not enough data-bearing nodes|waiting for replication timed out") // :-( + c.Assert(err, ErrorMatches, "timeout|timed out waiting for subordinates|Not enough data-bearing nodes|waiting for replication timed out") // :-( if !s.versionAtLeast(2, 6) { // 2.6 turned it into a query error. c.Assert(err.(*mgo.LastError).WTimeout, Equals, true) diff --git a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/stats.go b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/stats.go index 59723e60c2..e2ee15c784 100644 --- a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/stats.go +++ b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/stats.go @@ -68,8 +68,8 @@ func ResetStats() { type Stats struct { Clusters int - MasterConns int - SlaveConns int + MainConns int + SubordinateConns int SentOps int ReceivedOps int ReceivedDocs int @@ -86,13 +86,13 @@ func (stats *Stats) cluster(delta int) { } } -func (stats *Stats) conn(delta int, master bool) { +func (stats *Stats) conn(delta int, main bool) { if stats != nil { statsMutex.Lock() - if master { - stats.MasterConns += delta + if main { + stats.MainConns += delta } else { - stats.SlaveConns += delta + stats.SubordinateConns += delta } statsMutex.Unlock() } diff --git a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/suite_test.go b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/suite_test.go index ad1576936c..0c2b9155be 100644 --- a/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/suite_test.go +++ b/src/normous/gotools/vendor/src/gopkg.in/mgo.v2/suite_test.go @@ -141,7 +141,7 @@ func (s *S) TearDownTest(c *C) { } func (s *S) Stop(host string) { - // Give a moment for slaves to sync and avoid getting rollback issues. + // Give a moment for subordinates to sync and avoid getting rollback issues. panicOnWindows() time.Sleep(2 * time.Second) err := run("svc -d _harness/daemons/" + supvName(host)) diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py index 8161502cc9..d2aa5db39f 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py @@ -310,12 +310,12 @@ def get_all_children(self): """Returns all unique children (dependencies) for all batches of this Executor. - The Taskmaster can recognize when it's already evaluated a + The Taskmain can recognize when it's already evaluated a Node, so we don't have to make this list unique for its intended canonical use case, but we expect there to be a lot of redundancy (long lists of batched .cc files #including the same .h files over and over), so removing the duplicates once up front should - save the Taskmaster a lot of work. + save the Taskmain a lot of work. """ result = SCons.Util.UniqueList([]) for target in self.get_all_targets(): diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Job.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Job.py index 19cf3be9d2..2d99ed2b93 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Job.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Job.py @@ -68,9 +68,9 @@ class Jobs(object): methods for starting, stopping, and waiting on all N jobs. """ - def __init__(self, num, taskmaster): + def __init__(self, num, taskmain): """ - Create 'num' jobs using the given taskmaster. + Create 'num' jobs using the given taskmain. If 'num' is 1 or less, then a serial job will be used, otherwise a parallel job with 'num' worker threads will @@ -89,12 +89,12 @@ class can't do it, it gets reset to 1. Wrapping interfaces that stack_size = default_stack_size try: - self.job = Parallel(taskmaster, num, stack_size) + self.job = Parallel(taskmain, num, stack_size) self.num_jobs = num except NameError: pass if self.job is None: - self.job = Serial(taskmaster) + self.job = Serial(taskmain) self.num_jobs = 1 def run(self, postfunc=lambda: None): @@ -125,7 +125,7 @@ def _setup_sig_handler(self): b) SIGTERM: kill or system shutdown c) SIGHUP: Controlling shell exiting - We handle all of these cases by stopping the taskmaster. It + We handle all of these cases by stopping the taskmain. It turns out that it's very difficult to stop the build process by throwing asynchronously an exception such as KeyboardInterrupt. For example, the python Condition @@ -140,7 +140,7 @@ def _setup_sig_handler(self): """ def handler(signum, stack, self=self, parentpid=os.getpid()): if os.getpid() == parentpid: - self.job.taskmaster.stop() + self.job.taskmain.stop() self.job.interrupted.set() else: os._exit(2) @@ -171,26 +171,26 @@ class Serial(object): This class is not thread safe. """ - def __init__(self, taskmaster): - """Create a new serial job given a taskmaster. + def __init__(self, taskmain): + """Create a new serial job given a taskmain. - The taskmaster's next_task() method should return the next task + The taskmain's next_task() method should return the next task that needs to be executed, or None if there are no more tasks. The - taskmaster's executed() method will be called for each task when it + taskmain's executed() method will be called for each task when it is successfully executed, or failed() will be called if it failed to execute (e.g. execute() raised an exception).""" - self.taskmaster = taskmaster + self.taskmain = taskmain self.interrupted = InterruptState() def start(self): - """Start the job. This will begin pulling tasks from the taskmaster + """Start the job. This will begin pulling tasks from the taskmain and executing them, and return when there are no more tasks. If a task fails to execute (i.e. execute() raises an exception), then the job will stop.""" while True: - task = self.taskmaster.next_task() + task = self.taskmain.next_task() if task is None: break @@ -216,7 +216,7 @@ def start(self): task.executed() task.postprocess() - self.taskmaster.cleanup() + self.taskmain.cleanup() # Trap import failure so that everything in the Job module but the @@ -345,22 +345,22 @@ class Parallel(object): This class is thread safe. """ - def __init__(self, taskmaster, num, stack_size): - """Create a new parallel job given a taskmaster. + def __init__(self, taskmain, num, stack_size): + """Create a new parallel job given a taskmain. - The taskmaster's next_task() method should return the next + The taskmain's next_task() method should return the next task that needs to be executed, or None if there are no more - tasks. The taskmaster's executed() method will be called + tasks. The taskmain's executed() method will be called for each task when it is successfully executed, or failed() will be called if the task failed to execute (i.e. execute() raised an exception). - Note: calls to taskmaster are serialized, but calls to + Note: calls to taskmain are serialized, but calls to execute() on distinct tasks are not serialized, because that is the whole point of parallel jobs: they can execute multiple tasks simultaneously. """ - self.taskmaster = taskmaster + self.taskmain = taskmain self.interrupted = InterruptState() self.tp = ThreadPool(num, stack_size, self.interrupted) @@ -368,7 +368,7 @@ def __init__(self, taskmaster, num, stack_size): def start(self): """Start the job. This will begin pulling tasks from the - taskmaster and executing them, and return when there are no + taskmain and executing them, and return when there are no more tasks. If a task fails to execute (i.e. execute() raises an exception), then the job will stop.""" @@ -378,7 +378,7 @@ def start(self): # Start up as many available tasks as we're # allowed to. while jobs < self.maxjobs: - task = self.taskmaster.next_task() + task = self.taskmain.next_task() if task is None: break @@ -426,7 +426,7 @@ def start(self): break self.tp.cleanup() - self.taskmaster.cleanup() + self.taskmain.cleanup() # Local Variables: # tab-width:4 diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py index 952be01ca9..29a7bfd698 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py @@ -1070,14 +1070,14 @@ def must_be_same(self, klass): self._morph() self.clear() - # The following methods can get called before the Taskmaster has + # The following methods can get called before the Taskmain has # had a chance to call disambiguate() directly to see if this Entry # should really be a Dir or a File. We therefore use these to call # disambiguate() transparently (from our caller's point of view). # # Right now, this minimal set of methods has been derived by just # looking at some of the methods that will obviously be called early - # in any of the various Taskmasters' calling sequences, and then + # in any of the various Taskmains' calling sequences, and then # empirically figuring out which additional methods are necessary # to make various tests pass. @@ -1788,7 +1788,7 @@ def get_found_includes(self, env, scanner, path): return scanner(self, env, path) # - # Taskmaster interface subsystem + # Taskmain interface subsystem # def prepare(self): @@ -3071,7 +3071,7 @@ def _rmv_existing(self): raise e # - # Taskmaster interface subsystem + # Taskmain interface subsystem # def make_ready(self): diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py index 6567489c30..bd66466162 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py @@ -677,13 +677,13 @@ def retrieve_from_cache(self): return 0 # - # Taskmaster interface subsystem + # Taskmain interface subsystem # def make_ready(self): """Get a Node ready for evaluation. - This is called before the Taskmaster decides if the Node is + This is called before the Taskmain decides if the Node is up-to-date or not. Overriding this method allows for a Node subclass to be disambiguated if necessary, or for an implicit source builder to be attached. @@ -693,7 +693,7 @@ def make_ready(self): def prepare(self): """Prepare for this Node to be built. - This is called after the Taskmaster has decided that the Node + This is called after the Taskmain has decided that the Node is out-of-date and must be rebuilt, but before actually calling the method to build the Node. @@ -726,7 +726,7 @@ def prepare(self): def build(self, **kw): """Actually build the node. - This is called by the Taskmaster after it's decided that the + This is called by the Taskmain after it's decided that the Node is out-of-date and must be rebuilt, and after the prepare() method has gotten everything, uh, prepared. diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py index fb1124b1fb..65f4d12b0e 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py @@ -49,7 +49,7 @@ import SCons.Errors import SCons.Job import SCons.Node.FS -import SCons.Taskmaster +import SCons.Taskmain import SCons.Util import SCons.Warnings import SCons.Conftest @@ -219,7 +219,7 @@ def flush(self): self.s.flush() -class SConfBuildTask(SCons.Taskmaster.AlwaysTask): +class SConfBuildTask(SCons.Taskmain.AlwaysTask): """ This is almost the same as SCons.Script.BuildTask. Handles SConfErrors correctly and knows about the current cache_mode. @@ -255,7 +255,7 @@ def failed(self): self.display('Caught exception while building "%s":\n' % self.targets[0]) sys.excepthook(*self.exc_info()) - return SCons.Taskmaster.Task.failed(self) + return SCons.Taskmain.Task.failed(self) def collect_node_states(self): # returns (is_up_to_date, cached_error, cachable) @@ -508,7 +508,7 @@ def BuildNodes(self, nodes): # ToDo: use user options for calc save_max_drift = SConfFS.get_max_drift() SConfFS.set_max_drift(0) - tm = SCons.Taskmaster.Taskmaster(nodes, SConfBuildTask) + tm = SCons.Taskmain.Taskmain(nodes, SConfBuildTask) # we don't want to build tests in parallel jobs = SCons.Job.Jobs(1, tm ) jobs.run() diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Interactive.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Interactive.py index bb9ab93321..990d31f087 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Interactive.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Interactive.py @@ -257,7 +257,7 @@ def add_to_seen_nodes(node, parent, seen_nodes=seen_nodes): node.set_state(SCons.Node.no_state) node.implicit = None - # Debug: Uncomment to verify that all Taskmaster reference + # Debug: Uncomment to verify that all Taskmain reference # counts have been reset to zero. #if node.ref_count != 0: # from SCons.Debug import Trace diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Main.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Main.py index d7c3a5940a..a66cb992cf 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Main.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Main.py @@ -54,7 +54,7 @@ import SCons.Platform import SCons.SConf import SCons.Script -import SCons.Taskmaster +import SCons.Taskmain import SCons.Util import SCons.Warnings @@ -152,7 +152,7 @@ def Progress(*args, **kw): def GetBuildFailures(): return _BuildFailures -class BuildTask(SCons.Taskmaster.OutOfDateTask): +class BuildTask(SCons.Taskmain.OutOfDateTask): """An SCons build task.""" progress = ProgressObject @@ -161,10 +161,10 @@ def display(self, message): def prepare(self): self.progress(self.targets[0]) - return SCons.Taskmaster.OutOfDateTask.prepare(self) + return SCons.Taskmain.OutOfDateTask.prepare(self) def needs_execute(self): - if SCons.Taskmaster.OutOfDateTask.needs_execute(self): + if SCons.Taskmain.OutOfDateTask.needs_execute(self): return True if self.top and self.targets[0].has_builder(): display("scons: `%s' is up to date." % str(self.node)) @@ -176,7 +176,7 @@ def execute(self): global first_command_start if first_command_start is None: first_command_start = start_time - SCons.Taskmaster.OutOfDateTask.execute(self) + SCons.Taskmain.OutOfDateTask.execute(self) if print_time: global cumulative_command_time global last_command_end @@ -190,13 +190,13 @@ def do_failed(self, status=2): global exit_status global this_build_status if self.options.ignore_errors: - SCons.Taskmaster.OutOfDateTask.executed(self) + SCons.Taskmain.OutOfDateTask.executed(self) elif self.options.keep_going: - SCons.Taskmaster.OutOfDateTask.fail_continue(self) + SCons.Taskmain.OutOfDateTask.fail_continue(self) exit_status = status this_build_status = status else: - SCons.Taskmaster.OutOfDateTask.fail_stop(self) + SCons.Taskmain.OutOfDateTask.fail_stop(self) exit_status = status this_build_status = status @@ -221,9 +221,9 @@ def executed(self): self.do_failed() else: print "scons: Nothing to be done for `%s'." % t - SCons.Taskmaster.OutOfDateTask.executed(self) + SCons.Taskmain.OutOfDateTask.executed(self) else: - SCons.Taskmaster.OutOfDateTask.executed(self) + SCons.Taskmain.OutOfDateTask.executed(self) def failed(self): # Handle the failure of a build task. The primary purpose here @@ -237,7 +237,7 @@ def failed(self): tb = None if t is None: - # The Taskmaster didn't record an exception for this Task; + # The Taskmain didn't record an exception for this Task; # see if the sys module has one. try: t, e, tb = sys.exc_info()[:] @@ -291,17 +291,17 @@ def postprocess(self): if tree: print print tree - SCons.Taskmaster.OutOfDateTask.postprocess(self) + SCons.Taskmain.OutOfDateTask.postprocess(self) def make_ready(self): """Make a task ready for execution""" - SCons.Taskmaster.OutOfDateTask.make_ready(self) + SCons.Taskmain.OutOfDateTask.make_ready(self) if self.out_of_date and self.options.debug_explain: explanation = self.out_of_date[0].explain() if explanation: sys.stdout.write("scons: " + explanation) -class CleanTask(SCons.Taskmaster.AlwaysTask): +class CleanTask(SCons.Taskmain.AlwaysTask): """An SCons clean task.""" def fs_delete(self, path, pathstr, remove=True): try: @@ -368,21 +368,21 @@ def remove(self): execute = remove - # We want the Taskmaster to update the Node states (and therefore + # We want the Taskmain to update the Node states (and therefore # handle reference counts, etc.), but we don't want to call # back to the Node's post-build methods, which would do things # we don't want, like store .sconsign information. - executed = SCons.Taskmaster.Task.executed_without_callbacks + executed = SCons.Taskmain.Task.executed_without_callbacks - # Have the Taskmaster arrange to "execute" all of the targets, because + # Have the Taskmain arrange to "execute" all of the targets, because # we'll figure out ourselves (in remove() or show() above) whether # anything really needs to be done. - make_ready = SCons.Taskmaster.Task.make_ready_all + make_ready = SCons.Taskmain.Task.make_ready_all def prepare(self): pass -class QuestionTask(SCons.Taskmaster.AlwaysTask): +class QuestionTask(SCons.Taskmain.AlwaysTask): """An SCons task for the -q (question) option.""" def prepare(self): pass @@ -663,7 +663,7 @@ def _set_debug_values(options): if "tree" in debug_values: options.tree_printers.append(TreePrinter()) if "prepare" in debug_values: - SCons.Taskmaster.print_prepare = 1 + SCons.Taskmain.print_prepare = 1 if "duplicate" in debug_values: SCons.Node.print_duplicate = 1 @@ -1228,13 +1228,13 @@ def order(dependencies): """Leave the order of dependencies alone.""" return dependencies - if options.taskmastertrace_file == '-': + if options.taskmaintrace_file == '-': tmtrace = sys.stdout - elif options.taskmastertrace_file: - tmtrace = open(options.taskmastertrace_file, 'wb') + elif options.taskmaintrace_file: + tmtrace = open(options.taskmaintrace_file, 'wb') else: tmtrace = None - taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, order, tmtrace) + taskmain = SCons.Taskmain.Taskmain(nodes, task_class, order, tmtrace) # Let the BuildTask objects get at the options to respond to the # various print_* settings, tree_printer list, etc. @@ -1242,7 +1242,7 @@ def order(dependencies): global num_jobs num_jobs = options.num_jobs - jobs = SCons.Job.Jobs(num_jobs, taskmaster) + jobs = SCons.Job.Jobs(num_jobs, taskmain) if num_jobs > 1: msg = None if jobs.num_jobs == 1: @@ -1386,7 +1386,7 @@ def main(): # there's no need to control them with --debug= options; they're # controlled by changing the source code. SCons.Debug.dump_caller_counts() - SCons.Taskmaster.dump_stats() + SCons.Taskmain.dump_stats() if print_time: total_time = time.time() - SCons.Script.start_time diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py index 9e9d5ce0c5..9d09166e44 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py @@ -820,9 +820,9 @@ def opt_implicit_deps(option, opt, value, parser): help="Set the stack size of the threads used to run jobs to N kilobytes.", metavar="N") - op.add_option('--taskmastertrace', + op.add_option('--taskmaintrace', nargs=1, - dest="taskmastertrace_file", default=None, + dest="taskmaintrace_file", default=None, action="store", help="Trace Node evaluation to FILE.", metavar="FILE") diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py index 829e1fc304..3c1a1d3daa 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py @@ -21,12 +21,12 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __doc__ = """ -Generic Taskmaster module for the SCons build engine. +Generic Taskmain module for the SCons build engine. This module contains the primary interface(s) between a wrapping user interface and the SCons build engine. There are two key classes here: - Taskmaster + Taskmain This is the main engine for walking the dependency graph and calling things to decide what does or doesn't need to be built. @@ -43,11 +43,11 @@ targets as its "build" action. There is also a separate subclass for suppressing this output when the -q option is used. - The Taskmaster instantiates a Task object for each (set of) + The Taskmain instantiates a Task object for each (set of) target(s) that it decides need to be evaluated and/or built. """ -__revision__ = "src/engine/SCons/Taskmaster.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog" +__revision__ = "src/engine/SCons/Taskmain.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog" from itertools import chain import operator @@ -69,7 +69,7 @@ print_prepare = 0 # set by option --debug=prepare # A subsystem for recording stats about how different Nodes are handled by -# the main Taskmaster loop. There's no external control here (no need for +# the main Taskmain loop. There's no external control here (no need for # a --debug= option); enable it by changing the value of CollectStats. CollectStats = None @@ -77,14 +77,14 @@ class Stats(object): """ A simple class for holding statistics about the disposition of a - Node by the Taskmaster. If we're collecting statistics, each Node - processed by the Taskmaster gets one of these attached, in which case - the Taskmaster records its decision each time it processes the Node. + Node by the Taskmain. If we're collecting statistics, each Node + processed by the Taskmain gets one of these attached, in which case + the Taskmain records its decision each time it processes the Node. (Ideally, that's just once per Node.) """ def __init__(self): """ - Instantiates a Taskmaster.Stats object, initializing all + Instantiates a Taskmain.Stats object, initializing all appropriate counters to zero. """ self.considered = 0 @@ -122,13 +122,13 @@ class Task(object): aspects of controlling a build, so any given application *should* be able to do what it wants by sub-classing this class and overriding methods as appropriate. If an application - needs to customize something by sub-classing Taskmaster (or + needs to customize something by sub-classing Taskmain (or some other build engine class), we should first try to migrate that functionality into this class. Note that it's generally a good idea for sub-classes to call these methods explicitly to update state, etc., rather than - roll their own interaction with Taskmaster from scratch. + roll their own interaction with Taskmain from scratch. """ def __init__(self, tm, targets, top, node): self.tm = tm @@ -166,7 +166,7 @@ def prepare(self): T = self.tm.trace if T: T.write(self.trace_message(u'Task.prepare()', self.node)) - # Now that it's the appropriate time, give the TaskMaster a + # Now that it's the appropriate time, give the TaskMain a # chance to raise any exceptions it encountered while preparing # this task. self.exception_raise() @@ -211,10 +211,10 @@ def needs_execute(self): # Deprecation Cycle) so the desired behavior is explicitly # determined by which concrete subclass is used. #raise NotImplementedError - msg = ('Taskmaster.Task is an abstract base class; instead of\n' + msg = ('Taskmain.Task is an abstract base class; instead of\n' '\tusing it directly, ' 'derive from it and override the abstract methods.') - SCons.Warnings.warn(SCons.Warnings.TaskmasterNeedsExecuteWarning, msg) + SCons.Warnings.warn(SCons.Warnings.TaskmainNeedsExecuteWarning, msg) return True def execute(self): @@ -265,7 +265,7 @@ def execute(self): def executed_without_callbacks(self): """ Called when the task has been successfully executed - and the Taskmaster instance doesn't want to call + and the Taskmain instance doesn't want to call the Node's callback methods. """ T = self.tm.trace @@ -281,7 +281,7 @@ def executed_without_callbacks(self): def executed_with_callbacks(self): """ Called when the task has been successfully executed and - the Taskmaster instance wants to call the Node's callback + the Taskmain instance wants to call the Node's callback methods. This may have been a do-nothing operation (to preserve build @@ -341,7 +341,7 @@ def fail_stop(self): # list. self.tm.will_not_build(self.targets, lambda n: n.set_state(NODE_FAILED)) - # Tell the taskmaster to not start any new tasks + # Tell the taskmain to not start any new tasks self.tm.stop() # We're stopping because of a build failure, but give the @@ -492,7 +492,7 @@ def postprocess(self): # must be raised, but must be raised at an appropriate time and in # a controlled manner so we can, if necessary, recover gracefully, # possibly write out signature information for Nodes we've updated, - # etc. This is done by having the Taskmaster tell us about the + # etc. This is done by having the Taskmain tell us about the # exception, and letting def exc_info(self): @@ -549,8 +549,8 @@ def needs_execute(self): of only executing Nodes that are out of date w.r.t. their dependencies) can use this as follows: - class MyTaskSubclass(SCons.Taskmaster.Task): - needs_execute = SCons.Taskmaster.Task.execute_always + class MyTaskSubclass(SCons.Taskmain.Task): + needs_execute = SCons.Taskmain.Task.execute_always """ return True @@ -578,9 +578,9 @@ def find_cycle(stack, visited): return None -class Taskmaster(object): +class Taskmain(object): """ - The Taskmaster for walking the dependency DAG. + The Taskmain for walking the dependency DAG. """ def __init__(self, targets=[], tasker=None, order=None, trace=None): @@ -604,7 +604,7 @@ def find_next_candidate(self): Returns the next candidate Node for (potential) evaluation. The candidate list (really a stack) initially consists of all of - the top-level (command line) targets provided when the Taskmaster + the top-level (command line) targets provided when the Taskmain was initialized. While we walk the DAG, visiting Nodes, all the children that haven't finished processing get pushed on to the candidate list. Each child can then be popped and examined in @@ -637,9 +637,9 @@ def find_next_candidate(self): def no_next_candidate(self): """ - Stops Taskmaster processing by not returning a next candidate. + Stops Taskmain processing by not returning a next candidate. - Note that we have to clean-up the Taskmaster candidate list + Note that we have to clean-up the Taskmain candidate list because the cycle detection depends on the fact all nodes have been processed somehow. """ @@ -654,7 +654,7 @@ def _validate_pending_children(self): Validate the content of the pending_children set. Assert if an internal error is found. - This function is used strictly for debugging the taskmaster by + This function is used strictly for debugging the taskmain by checking that no invariants are violated. It is not used in normal operation. @@ -663,10 +663,10 @@ def _validate_pending_children(self): found in the "pending" state when checking the dependencies of its parent node. - A pending child can occur when the Taskmaster completes a loop + A pending child can occur when the Taskmain completes a loop through a cycle. For example, let's imagine a graph made of three nodes (A, B and C) making a cycle. The evaluation starts - at node A. The Taskmaster first considers whether node A's + at node A. The Taskmain first considers whether node A's child B is up-to-date. Then, recursively, node B needs to check whether node C is up-to-date. This leaves us with a dependency graph looking like: @@ -678,11 +678,11 @@ def _validate_pending_children(self): | | +-------------------------------------+ - Now, when the Taskmaster examines the Node C's child Node A, + Now, when the Taskmain examines the Node C's child Node A, it finds that Node A is in the "pending" state. Therefore, Node A is a pending child of node C. - Pending children indicate that the Taskmaster has potentially + Pending children indicate that the Taskmain has potentially loop back through a cycle. We say potentially because it could also occur when a DAG is evaluated in parallel. For example, consider the following graph: @@ -695,9 +695,9 @@ def _validate_pending_children(self): / Next candidate / - The Taskmaster first evaluates the nodes A, B, and C and + The Taskmain first evaluates the nodes A, B, and C and starts building some children of node C. Assuming, that the - maximum parallel level has not been reached, the Taskmaster + maximum parallel level has not been reached, the Taskmain will examine Node D. It will find that Node C is a pending child of Node D. @@ -715,7 +715,7 @@ def _validate_pending_children(self): children involved in a cycle will still be in the pending state. - The taskmaster removes nodes from the pending_children set as + The taskmain removes nodes from the pending_children set as soon as a pending_children node moves out of the pending state. This also helps to keep the pending_children set small. """ @@ -729,7 +729,7 @@ def _validate_pending_children(self): def trace_message(self, message): - return 'Taskmaster: %s\n' % message + return 'Taskmain: %s\n' % message def trace_node(self, node): return '<%-10s %-3s %s>' % (StateString[node.get_state()], @@ -1003,7 +1003,7 @@ def will_not_build(self, nodes, node_func=lambda n: None): pass # We have the stick back the pending_children list into the - # taskmaster because the python 1.5.2 compatibility does not + # taskmain because the python 1.5.2 compatibility does not # allow us to use in-place updates self.pending_children = pending_children diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Warnings.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Warnings.py index adf1eabd15..5551937eb5 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Warnings.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Warnings.py @@ -129,7 +129,7 @@ class DeprecatedSourceCodeWarning(FutureDeprecatedWarning): class DeprecatedBuildDirWarning(DeprecatedWarning): pass -class TaskmasterNeedsExecuteWarning(DeprecatedWarning): +class TaskmainNeedsExecuteWarning(DeprecatedWarning): pass class DeprecatedCopyWarning(MandatoryDeprecatedWarning): diff --git a/src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/doc/conf.py b/src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/doc/conf.py index de5fdd4224..81e6b3d4ce 100644 --- a/src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/doc/conf.py +++ b/src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/doc/conf.py @@ -33,8 +33,8 @@ # The encoding of source files. #source_encoding = 'utf-8' -# The master toctree document. -master_doc = 'index' +# The main toctree document. +main_doc = 'index' # General information about the project. project = u'testtools' diff --git a/src/third_party/wiredtiger/test/suite/test_base05.py b/src/third_party/wiredtiger/test/suite/test_base05.py index 847cbd0a73..0d7000c93a 100644 --- a/src/third_party/wiredtiger/test/suite/test_base05.py +++ b/src/third_party/wiredtiger/test/suite/test_base05.py @@ -118,8 +118,8 @@ def session_create(self, name, args): 'True, they rather order me about some, and make me jump from spar to spar, like a grasshopper in a May meadow.', 'And at first, this sort of thing is unpleasant enough.', 'It touches one\'s sense of honor, particularly if you come of an old established family in the land, the Van Rensselaers, or Randolphs, or Hardicanutes.', - 'And more than all, if just previous to putting your hand into the tar-pot, you have been lording it as a country schoolmaster, making the tallest boys stand in awe of you.', - 'The transition is a keen one, I assure you, from a schoolmaster to a sailor, and requires a strong decoction of Seneca and the Stoics to enable you to grin and bear it.', + 'And more than all, if just previous to putting your hand into the tar-pot, you have been lording it as a country schoolmain, making the tallest boys stand in awe of you.', + 'The transition is a keen one, I assure you, from a schoolmain to a sailor, and requires a strong decoction of Seneca and the Stoics to enable you to grin and bear it.', 'But even this wears off in time.' ]