MongoServerError on single replica set after upgrading to v9.6
help
### Prerequisites
- [x] I have written a descriptive issue title
- [x] I have searched existing issues to ensure the issue has not already been raised
### Issue
- Node.js version: v24.15
- Mongoose version: 9.6/9.6.1 (Upgraded from 9.5)
- MongoDB Version: 6.0 (Single Replica Set)
- My test environment URL: `mongodb://localhost/test?replicaSet=rs0`
I encountered an issue after upgrading from v9.5 to v9.6/9.6.1. In my test environment, I am now seeing the following error:
```
MongoServerError: Only servers in a sharded cluster can start a new transaction at the active transaction number
```
I am running this against a single replica set (rs0). This setup worked perfectly on v9.5, but the error started appearing immediately after the version bump.
I am aware that MongoDB 6.0 is an older version, but it is currently the environment I need to support. It seems the new driver version might be initiating transactions or retryable writes in a way that MongoDB 6.0 interprets as a sharded-cluster-only command.
Does anyone have an idea why this behavior changed in v9.6? Are there any specific flags or configurations I should use to maintain compatibility with MongoDB 6.0 in a non-sharded setup?
2 条评论