[JAVA-1757] Fix intermittent failure of driver-async SmokeTestSpecification Created: 09/Apr/15  Updated: 18/Sep/15  Resolved: 10/Apr/15

Status: Closed
Project: Java Driver
Component/s: Test Coverage
Affects Version/s: 3.0.0
Fix Version/s: 3.0.1, 3.1.0

Type: Improvement Priority: Minor - P4
Reporter: Ross Lawley Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-17955 renaming a collection fails in mongos... Closed

 Description   

There seems to be a rarely hit race condition when renaming a collection in the async smoke test. It only occurs when running with a seed list of mongos servers that the MongoClient is load balancing.

[Test com.mongodb.async.client.SmokeTestSpecification > should handle common administrative scenarios without error] FAILURE (689 ms)  Started at: 1428573023189
 
com.mongodb.async.client.SmokeTestSpecification > should handle common administrative scenarios without error FAILED
    com.mongodb.MongoCommandException: Command failed with error 13140: 'exception: Don't recognize source or target DB' on server localhost:27017. The full response is { "code" : 13140, "ok" : 0.0, "errmsg" : "exception: Don't recognize source or target DB" }



 Comments   
Comment by Jeffrey Yemin [ 05/May/15 ]

Closed for 3.0.1 release.

Comment by Githook User [ 10/Apr/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Working around sharding issue by only testing collection rename when not connected to a sharded cluster

JAVA-1757
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/4b7892c9c2840463c82d2c6e51ea42f0d5d8a6f0

Comment by Githook User [ 10/Apr/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Working around sharding issue by only testing collection rename when not connected to a sharded cluster

JAVA-1757
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/611fbdc1c1c601352031082c7c72e8b2be6f0c82

Comment by Jeffrey Yemin [ 09/Apr/15 ]

Reproducible with this simple test:

        MongoClient client = new MongoClient(asList(new ServerAddress("localhost", 27017)
                                                   , new ServerAddress("localhost", 27018)
                                                   ));
 
        MongoDatabase db = client.getDatabase("test");
        MongoCollection<Document> collection = db.getCollection("JAVA1757");
        MongoCollection<Document> newCollection = db.getCollection("newCollectionName");
 
        collection.drop();
        newCollection.drop();
 
        for (int i = 0; i < 100; i++) {
            try {
                db.drop();
                db.createCollection(collection.getNamespace().getCollectionName());
 
                collection.renameCollection(newCollection.getNamespace());
 
                newCollection.drop();
            } catch (MongoException e) {
                System.out.println(i + ": " + e.getMessage());
            }
 
        }
    }

Generated at Thu Feb 08 08:55:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.