-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Error Handling
-
Labels:None
-
Environment:Mongod: 2.2.1
Mongo Java Driver: 2.11.3
Sharded cluster:
* two replica sets per three members
* three config servers (mongod --config)
* one mongos
Invalid exception in case of mongos lost connection to all config servers.
STR:
1. Deploy mongo sharded cluster
2. Periodically write the data into mongo sharded cluster by using Mongo Java Driver & mongos instance
3. Kill all mongod config servers (mongod --config)
4. Execute the next command in mongos (through mongo shell) to clear current cluster information cached by a mongos & reload all sharded cluster metadata from the config database:
> db.adminCommand("flushRouterConfig");
The next invalid exception will be observed on Java side (Mongo Java Driver):
java.lang.IllegalArgumentException: 'ok' should never be null... at com.mongodb.CommandResult.ok(CommandResult.java:43) at com.mongodb.CommandResult.throwOnError(CommandResult.java:109) at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:102) at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:142) at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:115) at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:248) at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:204) at com.mongodb.DBCollection.insert(DBCollection.java:76) at com.mongodb.DBCollection.insert(DBCollection.java:60) at com.mongodb.DBCollection.insert(DBCollection.java:119) at com.llnw.edge.query.loader.UniquenessDaoImpl.insertAsStringSafe(UniquenessDaoImpl.java:76) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:69) at com.llnw.edge.query.loader.RetryTemplate.doExecute(RetryTemplate.java:245) at com.llnw.edge.query.loader.RetryTemplate.execute(RetryTemplate.java:138) at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy0.insertAsStringSafe(Unknown Source) at com.llnw.edge.query.loader.UniquenessLoadManager$AddUUIDTask$7.add(UniquenessLoadManager.java:329) at com.llnw.edge.query.loader.UniquenessLoadManager$AddUUIDTask.run(UniquenessLoadManager.java:385) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
But Mongo shell (connected to mongos) returns the next exception:
Mon Nov 4 18:49:10 uncaught exception: error { "$err" : "error loading initial database config information :: caused by :: all servers down!", "code" : 8002 }
Expected Result:
Any exception from mongo related exceptions stack instead of IllegalArgumentException.