-
Notifications
You must be signed in to change notification settings - Fork 109
[Develop] Add data integrity checks before removing backup directories #2727
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Updated restore_home_shared_data.rb to include a diff check before removing /tmp/home/ directory. - Ensures data in the new home directory is the same as the original before deleting the temporary backup. - Updated restore_internal_use_shared_data.rb to include a diff check before removing /tmp directories for each internal shared directory. - Ensures data in the new directory is the same as the original before deleting the temporary backup. - Added detailed comments to explain the new data integrity checks. This update prevents potential data loss or inconsistency during the restoration process.
gmarciani
requested changes
May 20, 2024
cookbooks/aws-parallelcluster-environment/recipes/init/restore_home_shared_data.rb
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/recipes/init/restore_internal_use_shared_data.rb
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/recipes/init/restore_home_shared_data.rb
Show resolved
Hide resolved
…te error messages and update spec tests - Modified 'config_default_user_home.rb' to include data integrity checks during the process of moving the cluster user's default home directory. This ensures the data in the new directory matches the original before deletion. - Updated error message when data integrity checks fail to show the difference. - Enhanced tests in 'config_default_user_home_spec.rb' to verify the data integrity check logic in the 'config_default_user_home.rb' recipe. - Enhanced tests in 'mount_internal_use_efs_spec.rb' to verify the data integrity check logic in the 'restore_internal_use_shared_data.rb' recipe.
gmarciani
reviewed
May 21, 2024
cookbooks/aws-parallelcluster-environment/spec/unit/recipes/config_default_user_home_spec.rb
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/spec/unit/recipes/config_default_user_home_spec.rb
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/recipes/init/restore_home_shared_data.rb
Show resolved
Hide resolved
…ption comments. Output error messages to stderr to ensure we can see it in chef-client.log. Add restart sshd service in config_default_user_home.rb, or after failed, user will can not ssh into the instance.
gmarciani
reviewed
May 22, 2024
cookbooks/aws-parallelcluster-environment/recipes/init/config_default_user_home.rb
Outdated
Show resolved
Hide resolved
e8980d1 to
366af3a
Compare
…er_local_home}) so that the script will not reach the if else part.
cookbooks/aws-parallelcluster-environment/recipes/init/config_default_user_home.rb
Show resolved
Hide resolved
…et -e for the existing bash script.
cookbooks/aws-parallelcluster-environment/recipes/init/config_default_user_home.rb
Outdated
Show resolved
Hide resolved
gmarciani
reviewed
May 24, 2024
cookbooks/aws-parallelcluster-environment/recipes/init/config_default_user_home.rb
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/recipes/init/config_default_user_home.rb
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/recipes/init/config_default_user_home.rb
Show resolved
Hide resolved
dreambeyondorange
approved these changes
May 28, 2024
Contributor
dreambeyondorange
left a comment
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.
LGTM!
gmarciani
reviewed
May 28, 2024
cookbooks/aws-parallelcluster-environment/recipes/init/restore_home_shared_data.rb
Show resolved
Hide resolved
gmarciani
approved these changes
May 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.x
skip-changelog-update
skip-recursive-deletion-check
Skip the checks regarding the use of recursive deletion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
Updated
restore_home_shared_data.rbto include a diff check before removing /tmp/home/ directory.Updated
restore_internal_use_shared_data.rbto include a diff check before removing /tmp directories for each internal shared directory.Updated
config_default_user_home.rbto include data integrity checks during the process of moving the cluster user's default home directory.Added detailed comments to explain the new data integrity checks.
Added new Spec tests.
This update prevents potential data loss or inconsistency during the restoration process.
Tests
config_default_user_home.rb:config_default_user_homerecipe. Ensured the home directory is moved correctly when no data integrity issues are present.node['cluster']['cluster_user_local_home']and modifying files in the expected directory to differ from the original. Manually runconfig_default_user_homerecipe. Verified that the script fails and outputs the correct error message in chef-client.log.Checklist
developadd the branch name as prefix in the PR title (e.g.[release-3.6]).Please review the guidelines for contributing and Pull Request Instructions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.