-
Notifications
You must be signed in to change notification settings - Fork 265
PHPLIB-1702: Always consult server encryptedFieldsMap when dropping collections #1742
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
Conversation
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.
The fix looks good, I have some comments on the tests.
$client = static::createTestClient(); | ||
|
||
// Ensure the key vault collection is dropped before each test | ||
$collection = $client->selectCollection('keyvault', 'datakeys', ['writeConcern' => new WriteConcern(WriteConcern::MAJORITY)]); |
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.
You'll get used to the new name of this method.
$collection = $client->selectCollection('keyvault', 'datakeys', ['writeConcern' => new WriteConcern(WriteConcern::MAJORITY)]); | |
$collection = $client->getCollection('keyvault', 'datakeys', ['writeConcern' => new WriteConcern(WriteConcern::MAJORITY)]); |
Why do you need to set the writeConcern
, as that doesn't guarantee that all replica are up to date.
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'm borrowing that from the CSFLE spec tests, which use w:majority
for all ops targeting the key vault collection. I reckon it makes little difference for tests, but in a production environment this would ensure that any modifications will persist through a replica set election.
{ | ||
protected ClientEncryption $clientEncryption; | ||
|
||
public function setUp(): void |
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.
Both test classes has the same setUp
method. They should probably be a single test class with 2 test methods.
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.
Converted this to a single test file in a new 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, but should this change target v1.21 for a patch release?
Superseded by #1745 |
https://jira.mongodb.org/browse/PHPLIB-1702