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

Generated Configurations might miss some files #2351

Closed
Thomas-Gelf opened this issue Jul 8, 2021 · 2 comments
Closed

Generated Configurations might miss some files #2351

Thomas-Gelf opened this issue Jul 8, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@Thomas-Gelf
Copy link
Contributor

Expected Behavior

Generating a Configuration should be an absolutely safe all-or-nothing operation

Current Behavior

In case you manage it to interrupt config rendering, there is a small time window where Config Files are already stored, Config Checksum has been stored, but Config <<==>> File references are still incomplete. They're stored line by line. Nothing bad happens at the first shot, deployment does not happen - as you interrupted it.

However, when you render the configuration again with no configuration change in the meantime, Director will find a reference pointing to an configuration, which matches the config generated in memory. It will therefore just link the existing configuration. Now you get a reference to this broken config - and are allowed to deploy it.

This is VERY hard to reproduce, as there is only a short time frame where this race condition can occur. It usually does not happen in case you "Deploy" a configuration, as it will still deploy the correct config from memory. But it might happen when you first "Generate" a configuration, interrupt the process, "Generate" again, look at the generated Config (manually in the UI) and then "Deploy" that specific generated Config - which unfortunately broke in the DB at the very first shot.

Possible Solution

Storing a generated Configuration should be part of a transaction, and being either COMMITted or ROLLed BACK at once.

@Thomas-Gelf Thomas-Gelf added the bug label Jul 8, 2021
@Thomas-Gelf Thomas-Gelf added this to the 1.9.0 milestone Jul 8, 2021
@Thomas-Gelf Thomas-Gelf self-assigned this Jul 8, 2021
@Thomas-Gelf
Copy link
Contributor Author

NB: the single (and potentially large) files should not be part of this transaction. This is about generated_config entries and linked generated_config_file_config references.

@Thomas-Gelf
Copy link
Contributor Author

ref/NC/728457

@Thomas-Gelf Thomas-Gelf modified the milestones: 1.9.0, 1.8.1 Jul 12, 2021
Thomas-Gelf added a commit that referenced this issue Jul 12, 2021
...transaction: all or nothing

fixes #2351
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant