-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-1680: Remove pre-4.2 wire version checks and test code #1801
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
base: v2.x
Are you sure you want to change the base?
Changes from all commits
1b4ef2a
4288925
22e3cc3
657f785
911fabc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -469,10 +469,6 @@ protected function skipIfCausalConsistencyIsNotSupported(): void | |
|
|
||
| protected function skipIfClientSideEncryptionIsNotSupported(): void | ||
| { | ||
| if (version_compare($this->getFeatureCompatibilityVersion(), '4.2', '<')) { | ||
| $this->markTestSkipped('Client Side Encryption only supported on FCV 4.2 or higher'); | ||
| } | ||
|
|
||
| if (static::getModuleInfo('libmongocrypt') === 'disabled') { | ||
| $this->markTestSkipped('Client Side Encryption is not enabled in the MongoDB extension'); | ||
| } | ||
|
|
@@ -491,16 +487,18 @@ protected function skipIfGeoHaystackIndexIsNotSupported(): void | |
|
|
||
| protected function skipIfTransactionsAreNotSupported(): void | ||
| { | ||
| if ($this->getPrimaryServer()->getType() === Server::TYPE_STANDALONE) { | ||
| $this->markTestSkipped('Transactions are not supported on standalone servers'); | ||
| } | ||
| switch ($this->getPrimaryServer()->getType()) { | ||
| case Server::TYPE_STANDALONE: | ||
| $this->markTestSkipped('Transactions are not supported on standalone servers'); | ||
| break; | ||
|
|
||
| if ($this->isShardedCluster()) { | ||
| $this->markTestSkipped('Transactions are only supported on FCV 4.2 or higher'); | ||
| } | ||
| case Server::TYPE_RS_PRIMARY: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The condition on
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previous behaviour was to skip on a standalone server, on sharded clusters (not sure why this was unconditional, it should've only skipped on sharded clusters < 4.2), and on replica sets with a storage engine other than WiredTiger. Since we're now always on 4.2 and higher, we can skip on standalones, check for WiredTiger on a primary, and always support sharded clusters, hence the change.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That stood out as an error to me (i.e. never running these tests on sharded clusters), but it went away with this change so I didn't call it out. The new logic assumes WiredTiger on sharded clusters since we can't ask |
||
| // Note: mongos does not report storage engine information | ||
| if ($this->getServerStorageEngine() !== 'wiredTiger') { | ||
| $this->markTestSkipped('Transactions require WiredTiger storage engine'); | ||
| } | ||
|
|
||
| if ($this->getServerStorageEngine() !== 'wiredTiger') { | ||
| $this->markTestSkipped('Transactions require WiredTiger storage engine'); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
Nit: Is this method still used after we remove everything? Not sure if we consider this public API, but we can remove the method if we consider it private and it's no longer used.
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.
It's still used by the Delete operation: https://github.com/mongodb/mongo-php-library/blob/2.1.2/src/Operation/Delete.php#L126-L133
I don't feel strongly about removing it after we raise the minimum server version to 4.4+, but I'm amenable to leaving it around and deprecated since it's technically public.