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.
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
[develop] Add logic to assert that the output of the diff command must do not contain lines starting with "Only in /tmp/home" #2748
[develop] Add logic to assert that the output of the diff command must do not contain lines starting with "Only in /tmp/home" #2748
Changes from 10 commits
beb5b81
ee8d286
63fcc41
db3c722
ec699ca
2d4dc04
15f8592
4fef7a7
2e6ea90
5a16e24
4ceb301
a8860bf
c12e053
8a5a407
bc4d7f8
b88fff7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Also I'm just noticing this
rm -rf #{user_home}
. This is very risky and should never be done.We should only delete temporary folders.
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.
We had a new
user_local_home
. Why we still needuser_home
which has the datauser_local_home
already have? Thisrm -rf #{user_home}
is the existing logic before I created the data integrity check PR. And we have used it for a long time. So it should be okay.Also, it's not a recipe, it's a spec test.
My concern is maybe the temp folder is useless. In this case, it's not like the
restore_home_shared_data.rb
, inrestore_home_shared_data.rb
we replace /home dir, so we need a temp folder to store data. But in this case, we can directly sync data from #{node['cluster']['cluster_user_home'] to #{node['cluster']['cluster_user_local_home']. But also the temp folder is the existing logic before I created the data integrity check PR.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.
We should avoid to do
rm -rf
on home directories because we do not want to take any risk of data loss, regardless if we need the data or not. We should not take the responsibility of removing /home data.What if, for whatever race condition, a remote file system is still attached to the original home directory?
In that case that rm -rf would remove everything from the remote file system and we would cause data loss.
We can say that there exist already a mitigation to this case: this recipe is executed before the recipes that mount the remote file systems, so we may be confident that at this point of the execution, no custom data exist yet in the home directories.
This is a good mitigation, but it's still not enough:
A very improbable, but still possible, example may be a custom AMI with a init.d script that mounts a remote file system. I agree that it's really really improbable, is the value worth the risk?
To sum up, we have a 99% mitigation of the data loss risk, but the potential cost of that 1% is disruptive.
In general, we should reason in terms of cost/opportunity.
A spec test typically reflects what the recipe is doing. If it does reflect it, then my comment applies to both the test and the recipe. If the test does not reflect the recipe, then we have a problem in the test.
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.
Yes, that explain my confusion, thank you Giacomo. I totally agree with the potential risks you mentioned.
You are correct! Can not agree more.
I know! I was just trying to say we should look at the recipe.
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.
Done and add a comment for it.