Skip to content

PHPC-1163: Prohibit session with unacknowledged write concern #814

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

Merged
merged 1 commit into from
Apr 24, 2018

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Apr 19, 2018

https://jira.mongodb.org/browse/PHPC-1163

This adds checks to ensure that explicit sessions and unacknowledged write concerns (explicit or inherited) will not be mixed when executing bulk writes or commands. Additionally, we ensure that command execution does not create its own implicit session (per PHPC-1152) if the effective write concern is unacknowledged.

Note: libmongoc still needs to ensure that it does not create implicit sessions for unacknowledged commands (CDRIVER-2615).

@jmikola jmikola requested review from derickr and kvwalker April 19, 2018 21:02
Copy link
Contributor

@kvwalker kvwalker left a comment

Choose a reason for hiding this comment

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

LGTM other than 1 typo

php_phongo.c Outdated

/* Determine if the explicit or inherited write concern is
* unacknowledged so that we can ensure it does not conflict with an
* explicit of implicit session. */
Copy link
Contributor

Choose a reason for hiding this comment

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

"explicit of implicit session" should be "explicit or implicit session"

@jmikola jmikola force-pushed the 1.4-phpc-1163 branch 2 times, most recently from a77aa65 to 159d25e Compare April 20, 2018 21:10
--TEST--
PHPC-1163: Unacknowledged write concern should omit implicit session
--XFAIL--
Depends on CDRIVER-2615
Copy link
Member Author

Choose a reason for hiding this comment

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

Tests pass locally after applying the patch from CDRIVER-2615, but feel free to verify on your own. In any event, that fix won't show up until libmongoc 1.10.

Copy link
Contributor

@derickr derickr left a comment

Choose a reason for hiding this comment

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

LGTM, except for the extra space in one of the test files.

--XFAIL--
Depends on CDRIVER-2615
--SKIPIF--
<?php if (PHP_INT_SIZE !== 8) { die("skip Can't represent 64-bit ints on a 32-bit platform"); } ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra space in front of <?php.

This adds checks to ensure that explicit sessions and unacknowledged write concerns (explicit or inherited) will not be mixed when executing bulk writes or commands. Additionally, we ensure that command execution does not create its own implicit session (per PHPC-1152) if the effective write concern is unacknowledged.

Note: libmongoc still needs to ensure that it does not create implicit sessions for unacknowledged commands (CDRIVER-2615).
@jmikola jmikola merged commit cceeda8 into mongodb:v1.4 Apr 24, 2018
jmikola added a commit that referenced this pull request Apr 24, 2018
@jmikola jmikola deleted the 1.4-phpc-1163 branch April 24, 2018 17:24
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