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

mc_worker_logic:make_request was being called with the wrong DB #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stephb9959
Copy link

Although the code was properly figuring out the right DB, it would always pass the Connection DB to the make_request.

…ys called with the connection DB instead of the possible DB as a parameter.
@comtihon
Copy link
Owner

comtihon commented Sep 2, 2019

Hi,
Can you please fix the tests?

@stephb9959
Copy link
Author

stephb9959 commented Sep 3, 2019 via email

@comtihon
Copy link
Owner

comtihon commented Sep 3, 2019

Hi,
mc_worker checks only ok when sending ensure index request.

{ok, _, _} =
    mc_worker_logic:make_request(
      Socket,
      NetModule,
      ConnState#conn_state.database,
      #insert{collection = mc_worker_logic:update_dbcoll(Coll, <<"system.indexes">>), documents = [Index]}),

mongo_api:ensure_index doesn't send anything to the database. It just prepares the request. You can rename it in this pr, if you find it confusing.

As far as I remember you always pass authentication against the specific database, so you can't just switch database in the same connection.
I am not talking about creating a new test, but all the old tests are failing for some reason. Although I am not sure it is because of your changes, as the latest master is also red.

@stephb9959
Copy link
Author

stephb9959 commented Sep 3, 2019 via email

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

Successfully merging this pull request may close these issues.

2 participants