Improve validation checks after copying#285
Merged
nikola-jokic merged 2 commits intoactions:mainfrom Nov 24, 2025
Merged
Conversation
The hash from the source is calculated only once. The source hash is checked with the destination hash, but if the destination hash does not match, the destination match is calculated again. The problem is that if the source hash is incorrect, the check will keep failing because the source hash is never re-calculated. Now, in the event that the hashes do not match, the hash of the source and the destination are calculated again.
Previously the %b parameter was used with stat. This displays the block size of the file. We noticed that in some cases the block size of the source and the destination file could be slightly different. Since the source and target run in different containers, they can have different block sizes defined. If the block size did not match, the hash would also not match, even if the file content would be exactly the same. With this change, the block size is no longer used. Instead the actual size in bytes of the file is listed.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These commits improve the validation process after copying data from the source to the destination pod.
A more detailed description is written in each of the commits.
The find command now uses %s to list the actual size of the file instead of the block size, as these can be different because the source and target run in different containers and can have a different block size that is defined.
We noticed this when investigating why the checksums did not match.
Another thing that is fixed in this PR is the fact that the source checksum is only generated once. If the checksums do not match, the target checksum is created again, but the source checksum is never recreated.
We noticed that sometimes there are files in the source that are not present in the target.
When checking manually with the
findcommand we saw that this diff is only temporary because if we ran the find command again, the files were the same.With this change, if the source and target hashes do not match, the hash of the source and target are created again. This prevents the above race condition from occurring multiple times.
Fixes #275
Fixes #269