laravel-mongodb
laravel-mongodb copied to clipboard
RetriableWrite operations are not retriable
- Laravel-mongodb Version: 3.9.5
- PHP Version: 8.1.9
- Database Driver & Version: 1.14.0
Description:
Perviously I created a PR with improvement for retriable write operations. Link: PR According to provided comment I was able to verify that our configuration meets the requirements, but still retry writes are not executed and we still continue facing this issue, while Atlas cluster scale up/down or other reasons while Primary node changes. We receiving an error and query are not retriable, which was verified by comparing actual result with expected data to be stored in database.
Our current options of connection string
mongodb+srv://user:password@host/database-name?retryWrites=true&w=majority&serverSelectionTryOnce=false&serverSelectionTimeoutMS=600000
MongoDB version: 6.0
Driver version: PHPC 1.14
Steps to reproduce
- Create a loop with write operations to mongodb cluster.
- Trigger a scale up/down cluster or run a failover test during query execution.
- Check logs with
not primary
exception and verify that query was not failed and data was not stored and retry write operation was not performed.
Expected behaviour
During switch of Primary node write operations should be retried.
Actual behaviour
During switch of Primary node write operations fails with one of the retriable error codes.