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

PHPLIB-1228: Run legacy transaction tests on LB topologies #1148

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

@@ -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',
Copy link
Member Author

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"
Copy link
Member Author

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

Copy link
Member Author

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

Copy link
Member Author

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.

Copy link
Member

@alcaeus alcaeus left a 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)',
Copy link
Member Author

Choose a reason for hiding this comment

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

@jmikola jmikola force-pushed the phplib-1228 branch 2 times, most recently from 90be148 to 28c435b Compare October 3, 2023 17:29
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.
@jmikola
Copy link
Member Author

jmikola commented Oct 4, 2023

Note: the Ubuntu 20.04 test failures are all related to kms_kmip_server.py and Python 3.12 (see: Slack thread).

Will merge as-is and forgo a PHPLIB ticket for the build failure since this will ultimately be resolved in drivers-evergreen-tools.

@jmikola jmikola merged commit 0017da3 into mongodb:master Oct 4, 2023
37 of 44 checks passed
@jmikola jmikola deleted the phplib-1228 branch October 4, 2023 16:59
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