Restore adding some jitter-ed sleep to shard scanning code.

Otherwise a large cluster will flood replicator manager with potentially
hundreds of thousands of `{resume, Shard}` messages. For each one, it
would try to open a changes feed which can add significant load and has
been seen in production to hit varios system limits.

This brings back the change from before the switch to using mem3 shards
for replicator db scans.

Also adds a few tests.

COUCHDB-3311
1 file changed
tree: 03904fe5d2a9434851868cff9f31f97b47493ea8
  1. .gitignore
  2. .travis.yml
  3. LICENSE
  4. priv/
  5. src/
  6. test/