-
Type: Task
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
In mongodb/mongo-php-library#840, there is a check to raise a client-side error when using an explicit write concern within a transaction. To quote:
Explicit read/writeConcerns are prohibited within a transaction, but renameCollection is not in the list of commands that can be run within a transaction.
This bit of code was copied from other operation classes, most of which are for commands that are supported in transactions; however, this is also found in some prohibited ops such as DropCollection. All of this dates back to 39f59b2 (
PHPLIB-368) so it's quite possible it was an oversight and missed during that review.I suppose one could argue it's safer to keep this check on any operation that solicits a read/writeConcern on the off chance these ops become allowed within transactions down the line. In that case, we should confirm that we have this in all ops that take explicit read/writeConcerns.
These checks can remain in place in the interest of defensive programming, but we should also audit the code to ensure the checks are done in all operations that take an explicit read and/or write concern.
- is related to
-
PHPLIB-518 Provide MongoDB\Collection::rename() method to rename a collection
- Closed