Resharding's oplog fetcher is currently using a DBClientBase for running an aggregation request to fetch oplog entries.
The DBClientBase omits some critical behavior such as:
- Not updating the logical clock values when receiving a response
- Does not perform targetting
- Will not use connections from a pool
Likewise, Shard has some limitations that made it difficult to use for the first milestone:
- Lack of aggregation support
- Does not expose a cursor/streaming interface
Shard also does not support exhaust cursors which is not necessary for a milestone, but would be an unfortunate lost optimization. It's unlikely that the underlying async Fetcher library that Shard uses will ever be able to make use of exhaust cursors.
When doing this ticket, it may be worth considering some unrealized optimizations when writing documents into the oplog. Specifically, batching an entire response into a single WUOW/transaction without requiring the caller making a copy of the response's buffer of BSON objects.