Running any of the retryable reads tests with operation debug logging enabled yields output like this:
23:01:28.857 [Test worker] DEBUG org.mongodb.driver.operation - Retrying the operation aggregate due to the error "com.mongodb.MongoNotPrimaryException: Command failed with error 10107 (NotWritablePrimary): 'Failing command via 'failCommand' failpoint' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Failing command via 'failCommand' failpoint", "code": 10107, "codeName": "NotWritablePrimary"}"; attempt #2 23:01:28.857 [Test worker] DEBUG org.mongodb.driver.operation - Retrying the operation aggregate due to the error "com.mongodb.MongoNotPrimaryException: Command failed with error 10107 (NotWritablePrimary): 'Failing command via 'failCommand' failpoint' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Failing command via 'failCommand' failpoint", "code": 10107, "codeName": "NotWritablePrimary"}"; attempt #2
It should only be logged once. Not sure if the same is true for retryable writes, but it likely is.
- links to