Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildscripts/burn_in_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/bypass_compile_and_fetch_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions buildscripts/clang_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/fetch_test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/generate_resmoke_suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/lifecycle_test_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/linter/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/resmokelib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions buildscripts/resmokelib/logging/buildlogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 7 additions & 7 deletions buildscripts/resmokelib/testing/fixtures/replicaset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/resmokelib/testing/hooks/dbhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions buildscripts/update_test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions pytests/powertest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
18 changes: 9 additions & 9 deletions src/normous/gotools/common/db/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,28 @@ 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 {
return Unknown, err
}
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
}
Expand Down Expand Up @@ -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
Expand Down
Loading