Skip to content

PHPLIB-1834: Send afterClusterTime on writes in causally-consistent sessions#1932

Closed
GromNaN wants to merge 3 commits into
mongodb:v2.xfrom
GromNaN:PHPLIB-1834
Closed

PHPLIB-1834: Send afterClusterTime on writes in causally-consistent sessions#1932
GromNaN wants to merge 3 commits into
mongodb:v2.xfrom
GromNaN:PHPLIB-1834

Conversation

@GromNaN

@GromNaN GromNaN commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

  • inherit an empty read concern for eligible writes in causally-consistent sessions
  • propagate readConcern to write execution paths handled by PHPLIB
  • add functional coverage for collection, database, and client write helpers

Testing

  • vendor/bin/phpcbf src/functions.php src/Client.php src/Collection.php src/Database.php src/Operation/InsertOne.php src/Operation/InsertMany.php src/Operation/BulkWrite.php src/Operation/Delete.php src/Operation/Update.php src/Operation/FindAndModify.php src/Operation/CreateCollection.php src/Operation/CreateIndexes.php src/Operation/DropCollection.php src/Operation/DropDatabase.php src/Operation/DropIndexes.php src/Operation/ClientBulkWriteCommand.php tests/Collection/CollectionFunctionalTest.php tests/Database/DatabaseFunctionalTest.php tests/ClientFunctionalTest.php
  • vendor/bin/phpcs src/functions.php src/Client.php src/Collection.php src/Database.php src/Operation/InsertOne.php src/Operation/InsertMany.php src/Operation/BulkWrite.php src/Operation/Delete.php src/Operation/Update.php src/Operation/FindAndModify.php src/Operation/CreateCollection.php src/Operation/CreateIndexes.php src/Operation/DropCollection.php src/Operation/DropDatabase.php src/Operation/DropIndexes.php src/Operation/ClientBulkWriteCommand.php tests/Collection/CollectionFunctionalTest.php tests/Database/DatabaseFunctionalTest.php tests/ClientFunctionalTest.php
  • php -l src/functions.php src/Client.php src/Collection.php src/Database.php src/Operation/InsertOne.php src/Operation/InsertMany.php src/Operation/BulkWrite.php src/Operation/Delete.php src/Operation/Update.php src/Operation/FindAndModify.php src/Operation/CreateCollection.php src/Operation/CreateIndexes.php src/Operation/DropCollection.php src/Operation/DropDatabase.php src/Operation/DropIndexes.php src/Operation/ClientBulkWriteCommand.php tests/Collection/CollectionFunctionalTest.php tests/Database/DatabaseFunctionalTest.php tests/ClientFunctionalTest.php
  • targeted phpunit coverage could not run locally because no mongod was available on localhost:27017

@codecov-commenter

codecov-commenter commented Jun 23, 2026

Copy link
Copy Markdown

@GromNaN

GromNaN commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

This implementation requires libmongoc to expose "afterClusterTime" in command events for causally consistent sessions. Without this, the driver cannot materialize the field in command monitoring events, making the assertions in these tests impossible to satisfy.

The tests have been marked with

to skip them until libmongoc supports this feature.

Closing this PR until the required libmongoc changes are available.

See: https://jira.mongodb.org/browse/PHPLIB-1834

@GromNaN GromNaN closed this Jun 24, 2026
@GromNaN GromNaN deleted the PHPLIB-1834 branch June 24, 2026 07:41
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