-
Notifications
You must be signed in to change notification settings - Fork 263
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
PHPLIB-1228: Run legacy transaction tests on LB topologies #1148
Conversation
cf47d95
to
6e519ad
Compare
@@ -36,6 +36,34 @@ class TransactionsSpecTest extends FunctionalTestCase | |||
'transactions/pin-mongos: unpin after transient error within a transaction and commit' => 'isMaster failpoints cannot be disabled', | |||
]; | |||
|
|||
private static array $incompleteLoadBalancerTests = [ | |||
'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on insertOne' => 'libmongoc does not pin for load-balanced topology', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is alluded to in the description of CDRIVER-4718 but not actually documented anywhere.
The reason libmongoc does not pin is because a mongoc_client_t
only has a single socket per endpoint (e.g. mongod, mongos, LB). Since clients themselves are pooled (unlike connections in other drivers), the idea of connecting pinning doesn't apply for a load balanced topology.
@@ -3,7 +3,8 @@ | |||
{ | |||
"minServerVersion": "4.1.8", | |||
"topology": [ | |||
"sharded" | |||
"sharded", | |||
"load-balanced" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one failure in the task log to investigate on a load balancer (not serverless):
[2023/09/27 23:08:36.560] FAILURE: (PHPUnit\Framework\ExpectationFailedException)
[2023/09/27 23:08:36.560] MongoDB\Tests\SpecTests\TransactionsSpecTest::testTransactions with data set "transactions/mongos-pin-auto: unpin after transient connection error on insertOne insert" (stdClass Object (...), array(stdClass Object (...)), array(stdClass Object (...), stdClass Object (...)), 'transaction-tests', 'test')
[2023/09/27 23:08:36.560] Failed asserting that null is not null.
[2023/09/27 23:08:36.560] /data/mci/2cd0f1f807b9a598faa6bcbc06dc1f76/src/tests/SpecTests/ErrorExpectation.php:145
[2023/09/27 23:08:36.560] /data/mci/2cd0f1f807b9a598faa6bcbc06dc1f76/src/tests/SpecTests/Operation.php:211
[2023/09/27 23:08:36.560] /data/mci/2cd0f1f807b9a598faa6bcbc06dc1f76/src/tests/SpecTests/TransactionsSpecTest.php:212
[2023/09/27 23:08:36.560] /data/mci/2cd0f1f807b9a598faa6bcbc06dc1f76/src/tests/SpecTests/TransactionsSpecTest.php:140
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch build running the test in isolation (passes): https://spruce.mongodb.com/version/65160090850e610a01d98d13/tasks
Patch build running the test in the full suite: https://spruce.mongodb.com/version/65160ba92fbabe5946c10a65/tasks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally identified the root cause of this. The legacy spec test runner never asserted that a session was pinned when executing targetedFailPoint
. Easy fix in PHPLIB-1270, which is now included in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM. Happy to skip the failing test and create a build failure ticket in JIRA to investigate separately.
'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on distinct distinct' => 'libmongoc does not pin for load-balanced topology', | ||
'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on runCommand insert' => 'libmongoc does not pin for load-balanced topology', | ||
'transactions/pin-mongos: multiple commits' => 'libmongoc does not pin for load-balanced topology', | ||
'transactions/mongos-pin-auto: unpin after transient error within a transaction' => 'libmongoc omits recoveryToken for load-balanced topology (CDRIVER-4718)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related PR: mongodb/mongo-c-driver#1417
90be148
to
28c435b
Compare
Synced with mongodb/specifications@38e65fc Skip select legacy transaction spec tests on load balancers (per libmongoc). This includes any tests that rely on session pinning, including those that use targetedFailPoint.
Note: the Ubuntu 20.04 test failures are all related to Will merge as-is and forgo a PHPLIB ticket for the build failure since this will ultimately be resolved in drivers-evergreen-tools. |
https://jira.mongodb.org/browse/PHPLIB-1228
https://jira.mongodb.org/browse/PHPLIB-1270
Patch build: https://spruce.mongodb.com/version/651c4fcd61837d018a6ef901/tasks