Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

Snapshot auto mount bricks on glusterd restart #1053

Merged
merged 2 commits into from
Oct 16, 2018

Conversation

rafikc30
Copy link
Member

Snapshot bricks should automatically mount upon a glusterd restart. Especially after glusterd restart, mount won't be existing on the machine. This PR will mount the snapshot bricks during a glusterd restart.

Copy link
Contributor

@rishubhjain rishubhjain left a comment

Choose a reason for hiding this comment

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

LGTM

glusterd2/volume/fs_utils.go Outdated Show resolved Hide resolved
glusterd2/volume/fs_utils.go Outdated Show resolved Hide resolved
glusterd2/volume/fs_utils.go Outdated Show resolved Hide resolved
glusterd2/volume/fs_utils.go Outdated Show resolved Hide resolved
}

if err := unix.Setxattr(brickinfo.Path, volumeIDXattrKey, vol.ID, 0); err != nil {
log.WithFields(log.Fields{"error": err.Error(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Its better to log error using WithError. log.WithError(err).WithFields...

return errors.New("volume size should provide to perform auto create")
}

if !req.SelfProvision && len(req.Subvols) <= 0 {
Copy link
Member

Choose a reason for hiding this comment

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

question:
what happens if I request for SelfProvision= true and req.Subvols length greater than zero

Copy link
Member Author

Choose a reason for hiding this comment

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

Since you requested for smartvol, given bricks should omit or we should have the capability of having both. But I will let @aravindavk answer the question as it is not specific to this PR.

glusterd2/volume/fs_utils.go Show resolved Hide resolved
@ghost ghost assigned rafikc30 Sep 24, 2018
@ghost ghost added the in progress label Sep 24, 2018
@rafikc30 rafikc30 force-pushed the snapshot_auto_mount branch 2 times, most recently from 25def30 to 64ac57a Compare September 26, 2018 17:24
Copy link
Member

@aravindavk aravindavk left a comment

Choose a reason for hiding this comment

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

LGTM

This PR contains lot of changes related to Snapshot restore, clean bricks refactor and other refactors. Please split the PRs in future when sending independent features in single PR

@ghost ghost assigned aravindavk Oct 9, 2018
glusterd2/brick/types.go Show resolved Hide resolved
plugins/device/deviceutils/store-utils.go Outdated Show resolved Hide resolved
Snapshot bricks are provisoned by glusterd. During a glusterd
restart, we should check for brick mounts for activated
snapshots.

Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
During a snapshot restore, we need to delete the parent
lv's if it is auto provisioned or snapshot provisioned

Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
@aravindavk
Copy link
Member

I see the review comments are addressed. I will merge this PR

@aravindavk aravindavk merged commit 73c66ca into gluster:master Oct 16, 2018
@ghost ghost removed the in progress label Oct 16, 2018
@rafikc30 rafikc30 deleted the snapshot_auto_mount branch November 22, 2018 14:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants