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

feat(probe): add mount change detection to mount probe #595

Merged
merged 29 commits into from
Jul 8, 2021

Conversation

z0marlin
Copy link
Contributor

@z0marlin z0marlin commented Jun 8, 2021

Detect mount point and filesystem changes.
The corresponding design document for this PR can be found in #594

Signed-off-by: Aditya Jain aditya.jainadityajain.jain@gmail.com

Checklist:

@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2021

Codecov Report

Merging #595 (e2cf87a) into master (e9ce0d7) will decrease coverage by 0.27%.
The diff coverage is 37.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #595      +/-   ##
==========================================
- Coverage   48.71%   48.44%   -0.28%     
==========================================
  Files          73       79       +6     
  Lines        3377     3720     +343     
==========================================
+ Hits         1645     1802     +157     
- Misses       1576     1758     +182     
- Partials      156      160       +4     
Impacted Files Coverage Δ
cmd/ndm_daemonset/controller/probe.go 100.00% <ø> (ø)
cmd/ndm_daemonset/probe/changehandler.go 0.00% <0.00%> (ø)
cmd/ndm_daemonset/probe/eventhandler.go 38.88% <0.00%> (-1.12%) ⬇️
cmd/ndm_daemonset/probe/udevprobe.go 65.57% <0.00%> (+3.14%) ⬆️
pkg/features/features.go 100.00% <ø> (ø)
pkg/mount/libmount/parse.go 0.00% <0.00%> (ø)
cmd/ndm_daemonset/probe/mountprobe.go 20.21% <7.93%> (-28.28%) ⬇️
pkg/mount/libmount/filesystem.go 26.08% <26.08%> (ø)
pkg/mount/libmount/mount_table.go 35.48% <35.48%> (ø)
pkg/epoll/epoll.go 64.47% <64.47%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9ce0d7...e2cf87a. Read the comment docs.


if isAllBlockDevices(msg.Devices) {
for _, bd := range pe.Controller.BDHierarchy {
err = pe.updateBlockDevice(&bd)
Copy link

Choose a reason for hiding this comment

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

G601: Implicit memory aliasing in for loop.
(at-me in a reply with help or ignore)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ignore

@z0marlin z0marlin force-pushed the mountch branch 2 times, most recently from a4c6a56 to 0583c80 Compare June 10, 2021 11:48

func (e *Epoll) Close() {
e.Stop()
syscall.Close(e.epfd)
Copy link

Choose a reason for hiding this comment

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

G104: Errors unhandled.
(at-me in a reply with help or ignore)

Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

@z0marlin Provided some initial comments on the PR

@akhilerm
Copy link
Contributor

@z0marlin Can you make this available via a feature gate, so epoll related code is not executed in normal workflow.

@z0marlin z0marlin marked this pull request as ready for review June 13, 2021 16:23
@z0marlin z0marlin force-pushed the mountch branch 4 times, most recently from de8fc09 to 608d7a0 Compare June 13, 2021 17:19
@akhilerm akhilerm self-requested a review June 14, 2021 05:07
pkg/epoll/epoll.go Outdated Show resolved Hide resolved
pkg/epoll/epoll.go Outdated Show resolved Hide resolved
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
- add nil pointer checks
- update mount file format constant names
- return appropriate errors in `MounTab.AddFilesystem()`
- handle err returned by options in `NewMountTab()`
- remove unused fields in `Filesystem`

Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
- add additional filters to filter out unnecessary changes in mount tab
diff
- don't clear `FileSystem` when updating an unmounted blockdevices

Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
rename functions in mount-change-tests to avoid confusion and conflicts
with existing functions in the package

Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
- add changelog
- update ndm yaml with the new feature gate ("MountChangeDetection")

Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
remove FIXME since openebs-archive#602 was merged

Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
@lgtm-com
Copy link

lgtm-com bot commented Jul 8, 2021

This pull request introduces 1 alert when merging 596f40b into e9ce0d7 - view on LGTM.com

new alerts:

  • 1 for Missing error check

akhilerm
akhilerm previously approved these changes Jul 8, 2021
Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

LGTM.

Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

LGTM

@lgtm-com
Copy link

lgtm-com bot commented Jul 8, 2021

This pull request introduces 1 alert when merging e2cf87a into e9ce0d7 - view on LGTM.com

new alerts:

  • 1 for Missing error check

@prateekpandey14 prateekpandey14 moved this from RC1 - Due: Jul 3 2021 to RC2 - Due: Jul 8 2021 in 2.11 Release Tracker - Due July 15th. Jul 8, 2021
@prateekpandey14 prateekpandey14 moved this from RC2 - Due: Jul 8 2021 to RC1 - Due: Jul 3 2021 in 2.11 Release Tracker - Due July 15th. Jul 8, 2021
@akhilerm akhilerm merged commit ae3f0b6 into openebs-archive:master Jul 8, 2021
2.11 Release Tracker - Due July 15th. automation moved this from RC1 - Due: Jul 3 2021 to Done Jul 8, 2021
@z0marlin z0marlin deleted the mountch branch October 12, 2021 05:17
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.

None yet

4 participants