MongoDB secondary stops applying oplog entries after intermittent TLS handshake errors between shard nodes
Environment
Sharded MongoDB 6.0 cluster: three replica sets for shards, each with primary and two secondaries. Internal cluster traffic uses TLS mutual authentication (certs rotated from an internal CA). Observed on AWS VPC across three AZs with VPC peering to a backup site.
Symptoms
A secondary node reports replication lag that grows and replication stops applying new operations; rs.status shows SECONDARY but recent oplog entries are not applied. The mongod log contains frequent TLS handshake failures (message: 'SSL peer certificate verification failed' and 'error during TLS handshake'). Manual rs.syncFrom to another member temporarily repairs state but lag returns.
Observations
TLS certificates on all members were rotated two days before issue appeared; timestamps and CA chain appear correct when inspected. Network-level packet captures show TLS ClientHello and ServerHello followed by connection resets from time to time between particular AZs. The issue is intermittent and correlates with higher cross-AZ latency spikes reported by cloud provider metrics. When the secondary is promoted to primary in tests, it functions normally until it later becomes secondary again and the problem recurs.
Already attempted
Rolled back to previous certs on one replica set — replication stabilized there. Increased the TLS handshake timeout settings in mongod config — provided limited improvement. Adjusted keepalive values at OS level — no durable change. Replaced network NIC on the affected host — problem persisted on other hosts in same AZ during latency spikes.
Question
How to reliably diagnose whether TLS handshake resets stem from certificate validation issues, network MTU/packet loss, or ephemeral cloud network path instability, and what safe mitigations (config or topology) can keep secondaries applying oplog entries during intermittent TLS failures?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags