Skip to content
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

[DPE-2648] POC Remove shards #262

Merged
merged 51 commits into from
Oct 9, 2023
Merged

[DPE-2648] POC Remove shards #262

merged 51 commits into from
Oct 9, 2023

Conversation

MiaAltieri
Copy link
Contributor

@MiaAltieri MiaAltieri commented Oct 6, 2023

Issue

Shard removal not implemented

Solution

Remove shards

Context

When tested by hand, it appears that it takes several calls of removeShard for the shard to be properly removed.

Limitations

This PR is limited by the behaviour that remote (and local) applications exhibit when scaling down. Specifically if two applications A and B are related and one of these applications scale down both A and B will receive relation-broken and relation-departed events. This can lead to some unwanted behaviour. (Which is shown in the consistently failing relation tests).

The workaround for this will require more research and potentially a new library for the code needed to fix this situation and will be done in the next PR.

See bug filed by DPE team regarding this
See ongoing conversation to find a clean solution

Testing

As this PR is a POC testing was done by hand:

# deploy shards + config server
juju deploy ./*charm --config role="config-server" config-server-one 
juju deploy ./*charm --config role="shard" shard-one 
juju deploy ./*charm --config role="shard" shard-two 

# relate shards
juju integrate config-server-one:config-server shard-one:sharding
juju integrate config-server-one:config-server shard-two:sharding

# remove a relation to shard
juju remove-relation config-server-one:config-server   shard-two:sharding

# manually verify shard config 
juju ssh config-server
charmed.mongodb.mongosh <URI>
sh.status()

# attempt to remove last replica and verify failure
juju remove-relation config-server-one:config-server   shard-one:sharding

lib/charms/mongodb/v0/shards_interface.py Show resolved Hide resolved
lib/charms/mongodb/v0/shards_interface.py Outdated Show resolved Hide resolved
lib/charms/mongodb/v0/mongos.py Outdated Show resolved Hide resolved
lib/charms/mongodb/v0/shards_interface.py Show resolved Hide resolved
@MiaAltieri MiaAltieri merged commit 15339e3 into 6/edge Oct 9, 2023
14 checks passed
@MiaAltieri MiaAltieri deleted the remove-shards branch October 9, 2023 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants