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

Add configuration setting for transactional flush #2587

Merged

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Nov 24, 2023

Adds a configuration setting to enable transactional flushes.

@alcaeus alcaeus requested a review from GromNaN November 27, 2023 07:39
@alcaeus alcaeus self-assigned this Nov 27, 2023
@alcaeus alcaeus merged commit 2effdd6 into doctrine:feature/transactions Nov 27, 2023
16 checks passed
@alcaeus alcaeus deleted the transactions/configuration branch November 27, 2023 12:53
alcaeus added a commit that referenced this pull request Dec 19, 2023
* Add configuration setting for transactional flush

* Use classic setters for transactional flush setting
alcaeus added a commit that referenced this pull request Dec 19, 2023
* Add configuration setting for transactional flush

* Use classic setters for transactional flush setting
alcaeus added a commit that referenced this pull request Jan 8, 2024
* Add configuration setting for transactional flush

* Use classic setters for transactional flush setting
@alcaeus alcaeus mentioned this pull request Jan 17, 2024
alcaeus added a commit that referenced this pull request Jan 19, 2024
* Run CI workflows on feature branches

* Refactor commit logic (#2580)

* Add tests for commit consistency showing wrong behaviour

* Clear scheduled document changes at the end of a commit operation

* Rename private variables to communicate intent

* Remove obsolete comment

* Use different error code

* Use single mongos in consistency tests

This ensures that the fail points are created on the same server that the write operations take place on, which can't be guaranteed in a sharded cluster with multiple mongoses.

* Rename test methods for clarity

* Explain reasoning for index error

* Extract helper method to create failpoint

* Add configuration setting for transactional flush (#2587)

* Add configuration setting for transactional flush

* Use classic setters for transactional flush setting

* Add logic for transactional commits (#2589)

* Extract commit logic

* Support transactional commit operations

* Always use transactional flush if supported

With this commit, all tests using the document manager use transactional flush as long as transactions are supported. Certain tests can use the static $allowsTransactions variable to disable this behaviour.

* Test with MongoDB 7.0

* Update test names

* Update phpstan baseline

* Fix query selection in shard key tests

* Flip transaction options constant by default

* Use supportsTransaction method when skipping tests

* Apply review feedback to tests

* Add separate test to check write concern in commit options

* Strip write options when in transaction

* Use majority write concern in test

* Update events to play nice with transactions (#2594)

* Pass session and transaction information to event args

* Only dispatch lifecycle events once per commit operation

* Remove isInTransaction property in event args

* Split method signature for readability

* Use property promotion for event args classes

* Extract construction of eventArgs

* Inline spl_object_hash calls

* Avoid injecting test instance

* Add session to commitOptions in persister

* Add session assertions in LifecycleEventManager

* Only retry transaction once (#2604)

* Only retry transaction once

* Rename variable

* Update transaction documentation (#2606)

* Remove references to transactions where not applicable

* Update transaction documentation

* Apply suggestions from code review

Co-authored-by: Jeremy Mikola <[email protected]>

* Change title level in event documentation

* Add documentation about transactions to event docs

---------

Co-authored-by: Jeremy Mikola <[email protected]>

* Address code review items

* Test highest dependencies on MongoDB 7.0

* Regenerate psalm baseline to silence unrelated errors

---------

Co-authored-by: Jeremy Mikola <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants