-
Notifications
You must be signed in to change notification settings - Fork 36
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
Conversation
Signed-off-by: Luciano Lo Giudice <[email protected]>
Signed-off-by: Luciano Lo Giudice <[email protected]>
Signed-off-by: Peter Sabaini <[email protected]>
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]>
Signed-off-by: Luciano Lo Giudice <[email protected]>
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.
Thanks!
As discussed, it'd be great to have some functional testing for these changes.
Otherwise lgtm, save for two minor nits noted inline
4c94287
to
09127e2
Compare
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.
Hi Luciano,
one request wrt looking up stable paths for WAL/DB devices (sorry for not flagging this earlier), otherwise lgtm
microceph/ceph/osd.go
Outdated
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 { |
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.
Hm, is there a reason to pass data
as by value and wal
/ db
by ref?
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.
wal and db may be nil, whereas data cannot.
microceph/api/disks.go
Outdated
@@ -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} |
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.
NIT: "data" definition should be consistent with wal/db object initialisation.
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.
Data can never be nil, hence why it's not a pointer.
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.
Few nitpicks around consistency and code-comments.
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.
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. |
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]>
Note: CI tests for this change will be taken up in a separate PR. |
This PR aims to add the needed support for write-ahead log (WAL) and database devices when adding OSDs to the cluster.