-
Type: New Feature
-
Status: Resolved
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Fix Version/s: None
-
Component/s: Core MongoDB
Currently Nuxeo is not robust when this scenario happens:
- Configure Nuxeo with MongoDB HA with replicaset mode (1 primary node, 3 secondary nodes, 1 arbitrary node), as recommended by Nuxeo
- Start Nuxeo
- Run a program which creates 50000 documents - it should last at least several minutes
- During the program execution, shut down the primary node
- Observe that there are some connection errors
Caused by: javax.net.ssl.SSLException: Connection reset at sun.security.ssl.Alert.createSSLException(Alert.java:127) ~[?:1.8.0_272] at sun.security.ssl.TransportContext.fatal(TransportContext.java:324) ~[?:1.8.0_272] at sun.security.ssl.TransportContext.fatal(TransportContext.java:267) ~[?:1.8.0_272] at sun.security.ssl.TransportContext.fatal(TransportContext.java:262) ~[?:1.8.0_272] at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1303) ~[?:1.8.0_272] at sun.security.ssl.SSLSocketImpl.access$300(SSLSocketImpl.java:72) ~[?:1.8.0_272] at sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:831) ~[?:1.8.0_272] at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:89) ~[mongo-java-driver-3.8.1.jar:?] at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:554) ~[mongo-java-driver-3.8.1.jar:?] at com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:425) ~[mongo-java-driver-3.8.1.jar:?] ... 155 more Suppressed: java.net.SocketException: Broken pipe (Write failed) at java.net.SocketOutputStream.socketWrite0(Native Method) ~[?:1.8.0_272] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) ~[?:1.8.0_272] at java.net.SocketOutputStream.write(SocketOutputStream.java:155) ~[?:1.8.0_272] at sun.security.ssl.SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:81) ~[?:1.8.0_272] at sun.security.ssl.TransportContext.fatal(TransportContext.java:355) ~[?:1.8.0_272] at sun.security.ssl.TransportContext.fatal(TransportContext.java:267) ~[?:1.8.0_272] at sun.security.ssl.TransportContext.fatal(TransportContext.java:262) ~[?:1.8.0_272] at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1303) ~[?:1.8.0_272] at sun.security.ssl.SSLSocketImpl.access$300(SSLSocketImpl.java:72) ~[?:1.8.0_272] at sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:831) ~[?:1.8.0_272] at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:89) ~[mongo-java-driver-3.8.1.jar:?] at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:554) ~[mongo-java-driver-3.8.1.jar:?]
There are several leads to improve Nuxeo
- use the Retryable API (retryable reads and writes https://docs.mongodb.com/manual/core/retryable-writes/ and https://docs.mongodb.com/manual/core/retryable-reads/ )
- implement a mechanism similar to the "validationQuery" in JDBC resource
Expected behavior:
All documents are created without any loss. The possible errors are logged as warning if Nuxeo was able to recover the query and run it again without another exception.