To support readAfterOptime, we can return the last visible optime in the repldata metadata. This value should be one of three things:
- for read commands:
- if read concern level majority was used for the read, the last visible optime should be the optime of the snapshot last used to return data for the query.
- if read concern level local was used, the last visible optime should be the last written optime in the oplog at the time of the query's conclusion
- for write commands:
- the last visible optime should simply be the optime assigned to the write operation