summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@gmail.com>2021-10-28 16:53:55 -0400
committerNick Vatamaniuc <nickva@users.noreply.github.com>2021-10-28 19:06:57 -0400
commit9af12991a440aaca0aa57f1aed136cf6ce93859d (patch)
tree3ec1ad39985d24c26bd4b1acfdcb7b90587a4a38
parentc119ac72ce151676d0bbc95abe199b16f0df9a79 (diff)
downloadcouchdb-9af12991a440aaca0aa57f1aed136cf6ce93859d.tar.gz
Use configured shards db in custodian instead of `"dbs"`
-rw-r--r--src/custodian/README2
-rw-r--r--src/custodian/src/custodian_server.erl3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/custodian/README b/src/custodian/README
index 72681f447..ff88373c5 100644
--- a/src/custodian/README
+++ b/src/custodian/README
@@ -1,6 +1,6 @@
Custodian is responsible for the data stored in CouchDB databases.
-Custodian scans the "dbs" database, which details the location of
+Custodian scans the shards database, which details the location of
every shard of every database and ensures that operators are aware of
any shard that is under-replicated (has less than N copies).
diff --git a/src/custodian/src/custodian_server.erl b/src/custodian/src/custodian_server.erl
index 0a21eed23..0c8b87e87 100644
--- a/src/custodian/src/custodian_server.erl
+++ b/src/custodian/src/custodian_server.erl
@@ -132,8 +132,9 @@ start_shard_checker(#state{shard_checker=Pid}=State) when is_pid(Pid) ->
start_event_listener() ->
+ DbName = mem3_sync:shards_db(),
couch_event:link_listener(
- ?MODULE, handle_db_event, nil, [{dbname, <<"dbs">>}]
+ ?MODULE, handle_db_event, nil, [{dbname, DbName}]
).
handle_db_event(_DbName, updated, _St) ->