Fix couch_replicator_manager rescans

When couch_replicator_manager starts it scans every _replicator database
looking for replications to start. When it starts the replication it
modifies a document in the _replicator database. This change ends up
sending a message back to couch_replicator_manager to rescan the
database. This message to rescan the database had no protection to be
unique. This would result in many processes re-scanning the same
database over and over.

To fix this we track the DbName for every scanning process so that if we
get a change to a database we can ignore the change because a scanner
pid is already running. However we also have to track if we need to
restart the scanning pid when it finishes so that we ensure that we
process any changes that occurred during the scan.

COUCHDB-2878
1 file changed
tree: 982d6eee4837fc481373c5a149e1fde77cfad070
  1. priv/
  2. src/
  3. test/
  4. .gitignore
  5. LICENSE