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

Bugs arising from encoding one logical operation as two operations #22

Open
SuperCuber opened this issue Nov 7, 2020 · 4 comments
Open

Comments

@SuperCuber
Copy link
Owner

Description

In --dry-run, if a template is supposed to be deleted and then created again with another target, it reports that as a cache corruption because it didn't actually delete the file.

Reproduction

Run with following file mapping:

foo = "bar"

Then run with following with --dry-run:

foo = "baz"
@SuperCuber
Copy link
Owner Author

Similar bugs happen for any case where a file is first deleted then created again - for example, swapping a template to a symlink during a dry run

@SuperCuber SuperCuber added the bug label Nov 9, 2020
@SuperCuber
Copy link
Owner Author

SuperCuber commented Nov 14, 2020

To solve this I'd probably need to restructure my deployment logic a bit and add a concept of "replace_template" and "replace_symlink", of course while handling all the edge cases.
I might need to rewrite FileState again for this too - it can be backed by a map

@SuperCuber SuperCuber added this to the Release 1.0.0 milestone Dec 13, 2020
@SuperCuber
Copy link
Owner Author

SuperCuber commented Dec 14, 2020

False negative case:

Going from empty to foo = "bar"; baz = "bar" should produce an "already exists" error but doesn't because file doesn't actually exist so it happily "creates" both

@SuperCuber
Copy link
Owner Author

SuperCuber commented Feb 3, 2021

The cases described previously are now fixed, but there's a new case:

Start with template a -> b deployed, modify b's contents, swap a -> b to symlink.
Now the deletion of the template is correctly skipped, but in a perfect world the creation of the symlink should not even be attempted.

The same will happen with a target location change

@SuperCuber SuperCuber changed the title [BUG] False-positive on cache corruption during dry run Bugs arising from encoding one logical operation as two operations Feb 3, 2021
SuperCuber pushed a commit that referenced this issue Feb 10, 2021
@SuperCuber SuperCuber removed this from the Release 1.0.0 milestone Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant