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
osd: Remove osd with purge instead of destroy #9807
Conversation
The osd destroy command leaves the osd id in use instead of fully purging the osd id. If the osd id is not also removed, it gives the impression that there is still something that needs to be cleaned up from the old osd. Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
072d0e1
to
879bde4
Compare
osd: Remove osd with purge instead of destroy (backport #9807)
@@ -174,19 +174,19 @@ func removeOSD(clusterdContext *clusterd.Context, clusterInfo *client.ClusterInf | |||
} | |||
|
|||
// purge the osd | |||
logger.Infof("destroying osd.%d", osdID) | |||
purgeOSDArgs := []string{"osd", "destroy", fmt.Sprintf("osd.%d", osdID), "--yes-i-really-mean-it"} | |||
logger.Infof("purging osd.%d", osdID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why I used destroy
instead of purge
was intentional so that we allow re-installing the OSD with the same ID, reducing data movement. When using destroy
, the OSD and the CRUSH details are kept intact, allowing a smooth device replacement.
But after all, we cannot get the same OSD ID since the device is brand new and is not a form of /dev/sdX
. So makes sense to use purge
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, for the common case it was just confusing that the osd id was left there. I wonder if we should document that as an advanced scenario. How could we replace a specific osd ID? Or you're saying it may be too difficult anyway to orchestrate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only way to achieve this would be to have the same disk name which means changing how we map the PVC disk when mounting/copying it. It's non-trivial for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC c-v also has a parameter for provisioning an OSD with a specific OSD ID to replace. Not sure how we would pass that either. The ID isn't desired state that would be added to the cluster CR, it's just one-time info to be used for the next OSD created.
Description of your changes:
The osd destroy command leaves the osd id in use instead of fully purging the osd id. If the osd id is not also removed, it gives the impression that there is still something that needs to be cleaned up from the old osd.
With the osd destroy, the osd id remains as seen here:
Keeping the destroy osd id is unnecessary. This seems an unintentional change from #9230.
Checklist:
make codegen
) has been run to update object specifications, if necessary.