New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot change shard map for system databases #858

Closed
wohali opened this Issue Oct 2, 2017 · 2 comments

Comments

Projects
None yet
1 participant
@wohali
Member

wohali commented Oct 2, 2017

Ported over from COUCHDB-3221

Expected Behaviour

Should be able to update the shard map for _users, _dbs, _replicator, _global_changes databases

Current Behaviour

{"error":"bad_request","reason":"Only reserved document ids may start with underscore."}

Possible Solution

Specifically whitelist these as database names internally, possibly via a config setting

Context

Unable to replace or add nodes to a cluster, then adjust the shard map for these 4 system databases as well.

@wohali

This comment has been minimized.

Show comment
Hide comment
@wohali

wohali Oct 2, 2017

Member

Original context:

I'm still seeing the same problem as described in COUCHDB-2424 with CouchDB 2.0.0 (Ubuntu) but it doesn't appear that I can reopen that issue.

What I'm trying to do trying to get a newly added cluster node to participate in all the databases already created in the cluster so that I can then remove an existing node and replace it with the new one. The workflow I have is:

  • Add the new node to the cluster using the _nodes endpoint. This works.
  • For each database edit the shard metadata document (e.g. _db/db_name) and add all shards to the new node.

This appears to work for all databases except the system databases. Essentially this means that you can't move the shards for these database off a node in order to retire that node.

An easy way to reproduce the issue is to open http://localhost:5986/_utils/#/database/_dbs/_metadata and then click "Save Changes" in Fauxton. The error "Save failed: Only reserved document ids may start with underscore." is displayed. Doing the same process for a user database works fine. Similarly, editing the document via curl also fails with the same error.

Member

wohali commented Oct 2, 2017

Original context:

I'm still seeing the same problem as described in COUCHDB-2424 with CouchDB 2.0.0 (Ubuntu) but it doesn't appear that I can reopen that issue.

What I'm trying to do trying to get a newly added cluster node to participate in all the databases already created in the cluster so that I can then remove an existing node and replace it with the new one. The workflow I have is:

  • Add the new node to the cluster using the _nodes endpoint. This works.
  • For each database edit the shard metadata document (e.g. _db/db_name) and add all shards to the new node.

This appears to work for all databases except the system databases. Essentially this means that you can't move the shards for these database off a node in order to retire that node.

An easy way to reproduce the issue is to open http://localhost:5986/_utils/#/database/_dbs/_metadata and then click "Save Changes" in Fauxton. The error "Save failed: Only reserved document ids may start with underscore." is displayed. Doing the same process for a user database works fine. Similarly, editing the document via curl also fails with the same error.

@wohali

This comment has been minimized.

Show comment
Hide comment
@wohali

wohali Oct 3, 2017

Member

FYI only workaround I can think of right now for this is that replacing a node should be possible IF the new node is named the same as an old node.

Member

wohali commented Oct 3, 2017

FYI only workaround I can think of right now for this is that replacing a node should be possible IF the new node is named the same as an old node.

@wohali wohali closed this in #862 Oct 5, 2017

wohali added a commit that referenced this issue Oct 5, 2017

Merge pull request #862 from apache/858-whitelist-shard-map-docids
Whitelist system DB names as valid _dbs docids

Closes #858
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment