-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.6.0
-
Component/s: None
-
None
-
(copied to CRM)
-
Empty show more show less
This issue appears to be a regression of NODE-680 and was introduced as a result of https://github.com/mongodb/node-mongodb-native/commit/38bcaf7c80f63885d4c0cf1f7389819efb0664e6#diff-aa40aa8bcfc7826a48153f27cc6a7c7cL44 associated with NODE-2569.
The following reproduction will fail in v3.6.2 but succeed in v3.5.10:
var MongoClient = require('mongodb').MongoClient const url = 'mongodb://localhost:27017,localhost:27018,localhost:27019/?replSet=replset&readPreference=secondary'; async function main() { const client = new MongoClient(url,{ keepAlive: true, connectTimeoutMS: 30000, socketTimeoutMS: 30000, useNewUrlParser: true, useUnifiedTopology: true }); client.on('connectionCheckOutStarted', event => console.dir(event)); await client.connect((err, client) => { if (err) throw err; }); const collection = client.db('foo').collection('bar'); await collection.createIndex({ baz: 1 }); process.exit(1); } main();
- duplicates
-
NODE-2784 MongoError: Not Master when running createIndex in 3.6.0
- Closed