Testing-only support for running transactions that only do reads on secondaries is going away with
SERVER-39139 and the CheckReplDBHashInBackground hook is being disabled along with it. We'd like to retain the ability to detect transient data inconsistency failures (e.g. related to timestamping differences between the primary and secondary of a replica set) that have been resolved by the time we've finished waiting for all operations to have replicated.
A testing-only query option should be introduced to call RecoveryUnit::setTimestampReadSource() with a supplied clusterTime to the find and dbHash commands. The run_check_repl_dbhash_background.js hook should be update to use this new option for getting the dbhash of a particular snapshot and computing the diff between replica set members should a mismatch arise.
Some care will need to be taken to handle (e.g. by retrying) the cursor getting killed as a result the collection or an index on the collection being dropped when attempting to compute the diff.