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

Add the WAL and DB devices for the disk-add command #222

Merged
merged 6 commits into from
Oct 6, 2023
Merged

Conversation

lmlg
Copy link
Contributor

@lmlg lmlg commented Sep 21, 2023

This PR aims to add the needed support for write-ahead log (WAL) and database devices when adding OSDs to the cluster.

Signed-off-by: Luciano Lo Giudice <[email protected]>
sabaini and others added 3 commits September 25, 2023 18:22
This commit moves the process of wiping, encrypting and symlinking
devices so that it can be reused for the data, WAL and DB devices.

Signed-off-by: Luciano Lo Giudice <[email protected]>
Copy link
Collaborator

@sabaini sabaini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
As discussed, it'd be great to have some functional testing for these changes.
Otherwise lgtm, save for two minor nits noted inline

microceph/ceph/osd.go Outdated Show resolved Hide resolved
microceph/ceph/osd.go Outdated Show resolved Hide resolved
@lmlg lmlg force-pushed the wal-db branch 2 times, most recently from 4c94287 to 09127e2 Compare September 27, 2023 21:06
Copy link
Collaborator

@sabaini sabaini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Luciano,
one request wrt looking up stable paths for WAL/DB devices (sorry for not flagging this earlier), otherwise lgtm

logger.Debugf("Adding OSD %s", path)
// AddOSD adds an OSD to the cluster, given the data, WAL and DB devices and their respective
// flags for wiping and encrypting.
func AddOSD(s *state.State, data types.DiskParameter, wal *types.DiskParameter, db *types.DiskParameter) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, is there a reason to pass data as by value and wal / db by ref?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wal and db may be nil, whereas data cannot.

microceph/ceph/osd.go Outdated Show resolved Hide resolved
@@ -56,7 +58,16 @@ func cmdDisksPost(s *state.State, r *http.Request) response.Response {

mu.Lock()
defer mu.Unlock()
err = ceph.AddOSD(s, req.Path, req.Wipe, req.Encrypt)

data := types.DiskParameter{req.Path, req.Encrypt, req.Wipe}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: "data" definition should be consistent with wal/db object initialisation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data can never be nil, hence why it's not a pointer.

Copy link
Contributor

@UtkarshBhatthere UtkarshBhatthere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nitpicks around consistency and code-comments.

Copy link
Collaborator

@sabaini sabaini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lmlg , changes lgtm!
Think the [WIP] tag could be removed now :-)
May I also suggest to squash commits (into one or more logical units)?

@lmlg
Copy link
Contributor Author

lmlg commented Oct 5, 2023

Hi @lmlg , changes lgtm! Think the [WIP] tag could be removed now :-) May I also suggest to squash commits (into one or more logical units)?

yes, of course.

@lmlg lmlg changed the title [WIP] Add the WAL and DB devices for the disk-add command Add the WAL and DB devices for the disk-add command Oct 5, 2023
This commit does the following:
- Reorder struct variables and move up cleanup.
- Fixes OSD cleanup.
- Skips symlinking WAL and DB devices since Ceph does it for us.
- Properly order script arguments.
- Factor out stable disk path management.

Signed-off-by: Luciano Lo Giudice <[email protected]>
@UtkarshBhatthere
Copy link
Contributor

Note: CI tests for this change will be taken up in a separate PR.

@UtkarshBhatthere UtkarshBhatthere merged commit d6334c1 into main Oct 6, 2023
14 checks passed
@UtkarshBhatthere UtkarshBhatthere deleted the wal-db branch November 29, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants