Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mlaunch fails to create a PSA without majority read concern #904

Open
FGasper opened this issue Feb 17, 2023 · 2 comments
Open

mlaunch fails to create a PSA without majority read concern #904

FGasper opened this issue Feb 17, 2023 · 2 comments

Comments

@FGasper
Copy link

FGasper commented Feb 17, 2023

Expected behavior

This:

mlaunch init --auth --replicaset --nodes 2 --arbiter --enableMajorityReadConcern false

… should create a PSA cluster with majority read concern disabled.

Actual/current behavior

> mlaunch init --auth --replicaset --nodes 2 --arbiter --enableMajorityReadConcern false
Detected mongod version: 6.2.0
Generating keyfile: /Users/felipe/data/keyfile
launching: "mongod" on port 27017
launching: "mongod" on port 27018
launching: "mongod" on port 27019
Traceback (most recent call last):
  File "/Users/felipe/Library/Python/3.11/bin/mlaunch", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/mtools/mlaunch/mlaunch.py", line 2191, in main
    tool.run()
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/mtools/mlaunch/mlaunch.py", line 628, in run
    getattr(self, self.args['command'])()
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/mtools/mlaunch/mlaunch.py", line 807, in init
    self._initiate_replset(nodes[0], self.args['name'])
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/mtools/mlaunch/mlaunch.py", line 1824, in _initiate_replset
    rs_status = con['admin'].command({'replSetGetStatus': 1})
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/pymongo/_csot.py", line 105, in csot_wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/pymongo/database.py", line 805, in command
    with self.__client._socket_for_reads(read_preference, session) as (
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/pymongo/mongo_client.py", line 1296, in _socket_for_reads
    server = self._select_server(read_preference, session)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/pymongo/mongo_client.py", line 1257, in _select_server
    server = topology.select_server(server_selector)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/pymongo/topology.py", line 272, in select_server
    server = self._select_server(selector, server_selection_timeout, address)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/pymongo/topology.py", line 261, in _select_server
    servers = self.select_servers(selector, server_selection_timeout, address)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/pymongo/topology.py", line 223, in select_servers
    server_descriptions = self._select_servers_loop(selector, server_timeout, address)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/felipe/Library/Python/3.11/lib/python/site-packages/pymongo/topology.py", line 238, in _select_servers_loop
    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 61] Connection refused, Timeout: 0.001s, Topology Description: <TopologyDescription id: 63eee76a5ce24c47881600d0, topology_type: Single, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:27017: [Errno 61] Connection refused')>]>

Steps to reproduce the actual/current behavior

Run the command.

Environment

macOS Ventura (latest as of this writing).

> uname -a
Darwin M-HJR99W7WX5 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 arm64
Software Version
mtools 1.7.2
Python 3.11
MongoDB server 6.2.0
Operating system macOS Ventura
@FGasper
Copy link
Author

FGasper commented Feb 17, 2023

Workaround: create the replica set, stop it, tweak the .mlaunch_startup file, then restart the replica set.

UPDATE: Actually, while this doesn’t display an error, it also doesn’t actually start the server.

@stennie
Copy link
Collaborator

stennie commented Feb 17, 2023

Hi @FGasper,

Per SERVER-53247: Disable enableMajorityReadConcern:false, this option is no longer supported in MongoDB 5.0 or newer.

Since you are testing with MongoDB 6.2.0, mongod will refuse to start with a log message like:

"msg":"enableMajorityReadConcern:false is no longer supported"

However, this startup error does not seem to be displaying properly in the develop branch of mtools, so the failure reason is not obvious (and should be fixed).

Regards,
Stennie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants