-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Summary
Add two mongod server parameters that let an operator set the TCP socket buffer sizes for replication connections, so a far-region secondary can fill its oplog-fetch pipe over a high-RTT link (BDP-limited). Built on the transport primitive from SERVER-131935.
Parameters
- replicationReceiveBufferSizeBytes — used by the oplog fetcher when creating its connection to the sync source; sets SO_RCVBUF on that egress socket (applied pre-handshake so the SYN negotiates a large window scale).
- replicationSendBufferSizeBytes — used by a node when acting as a sync source serving oplog; sets SO_SNDBUF on the ingress serving socket (applied on the oplog-serving path, i.e. where oplog bytes-sent are recorded).
- Both settable at startup (0 = leave the OS default / autotuning). Type: bytes.
Scope / Acceptance criteria
- Define the two parameters (IDL), gte: 0, default: 0.
- Oplog fetcher applies replicationReceiveBufferSizeBytes when establishing/reconnecting its DBClientConnection (value re-applied on reconnect).
- Sync source applies replicationSendBufferSizeBytes on the oplog getMore/find serving path.
- No effect when 0 (default) — preserves current autotuning behavior.
- (Optional/bonus, present in the PoC: make them runtime-settable and reconnect the oplog fetcher on change, so the value can be adjusted live. If kept startup-only, drop the reconnect logic.)
Validation
On the cross-region reproducer at ~120 ms RTT, setting both to 128 MB (with net.core.mem_max raised) cut the far-region secondary's replication lag from *777 s (median 280 s) to 7 s (median 1 s); the primary's send buffer and the secondary's receive window both reached ~256 MB. Majority-commit lag stayed ~0 throughout.
- is related to
-
SERVER-131935 Per-socket buffer sizing on replication connections in the transport layer
-
- Needs Scheduling
-
-
SERVER-132024 Query remote receive window size for TCP sockets
-
- Needs Scheduling
-