Skip to content

Conversation

p-mongo
Copy link
Contributor

@p-mongo p-mongo commented Feb 5, 2019

No description provided.

@p-mongo p-mongo changed the title 1420 RUBY-1420 Document session options Feb 5, 2019
@p-mongo p-mongo requested a review from saghm February 5, 2019 03:59
support_client.command(
{ create: @spec.collection_name },
{ write_concern: { w: :majority } })
support_client.command(create: @spec.collection_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec test runner description says that this should be run with write concern majority; is there a reason this was changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to my reading of the code write concern ended up getting passed to sessions where it was ignored. Database#command (which can be seen in this diff) does not document write concern as an accepted option. Therefore as far as I can tell the write concern here doesn't do anything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting; it looks like the read/write concern spec says that a write concern needs to be directly added to the command document. Can we do this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since repairing transaction spec runner does not have much to do with documenting session options, how about doing that in a follow-up PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case, why was it changed in this PR in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR documents session options. As part of that work I reviewed the callers to see which options they passed. As a result of that audit this change was made where existing code passed an option that had no effect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a little strange not to not make the one line fix here when we're already changing the same method call, but okay

support_client.command(
{ create: @spec.collection_name },
{ write_concern: { w: :majority } })
support_client.command(create: @spec.collection_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a little strange not to not make the one line fix here when we're already changing the same method call, but okay

Copy link
Contributor

@saghm saghm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, meant to approve

@p-mongo p-mongo merged commit ad144e8 into mongodb:master Feb 7, 2019
@p-mongo p-mongo deleted the 1420 branch February 7, 2019 16:47
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.

3 participants