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

Backup option breaks concat #359

Merged
merged 1 commit into from
Jul 29, 2015
Merged

Backup option breaks concat #359

merged 1 commit into from
Jul 29, 2015

Conversation

j-vizcaino
Copy link
Contributor

The backup option, provided to the concat resource is used to backup the final target file before overwritting it.
Problem is: the backup option is used for the concat fragments file resources and, even worse, the fragments directory.
It means that, when backup is enabled (say ".bak") and a fragment changes, the file is first backed up inside the fragment dir, then removed (directory has purge, recurse set to true), but backed up again because the File[/var/lib/puppet/concat/_target_file] also has backup => ".bak" !

The final concatenated file results in the fragment appearing twice !

Pull request fixes this issue.
I've been able to update unit test, but I can't run the acceptance ones. Maybe they need to be updated as well.
Please consider this before the 1.2.4 release, I think this is a really serious bug.

Thank you

@jhoblitt
Copy link
Contributor

I agree. Fragments should not be backed up and at one point that was the behavior of this module.

jhoblitt pushed a commit that referenced this pull request Jul 29, 2015
@jhoblitt jhoblitt merged commit 7c13aae into puppetlabs:1.2.x Jul 29, 2015
@j-vizcaino
Copy link
Contributor Author

Looking at the code in branch master, I think the same patch needs to be applied there (don't want to stumble upon the same bug when hitting the 2.x releases)

@jhoblitt
Copy link
Contributor

@j-vizcaino Actually, it looks like 1.2.x is ahead of master. Sigh. @hunner , @mhaskel , @cmurphy - is 1.2.x supposed to be forward merged into master or fixes cherry picked from master into that branch? Currently, 1.2.x has the 1.2.4 release it in while metadata.json in master still claims 1.2.3.

@underscorgan
Copy link
Contributor

@jhoblitt at this point all dev should be happing against master, just fyi. 1.2.x is just a release branch and 2.0.x is largely just there for posterity.

@bmjen
Copy link
Contributor

bmjen commented Jul 30, 2015

@j-vizcaino @jhoblitt the change to fragment backups is detailed in this PR.
#288

By essentially reverting this behavior, static-compilation will now break.

@j-vizcaino
Copy link
Contributor Author

@bmjen What do you mean by static-compilation ? RSpec tests are all green. Dunno about beaker tests though...

@bmjen
Copy link
Contributor

bmjen commented Jul 30, 2015

@j-vizcaino check out PR #288 and the comments in the referenced Jira ticket.
https://tickets.puppetlabs.com/browse/MODULES-1700

@j-vizcaino
Copy link
Contributor Author

@bmjen I don't see why the backup parameter has anything to do with the helper script not being deployed... it seems pretty strange.

Anyway, activating backup for the fragments leads to a severe regression that causes updated fragments to appear twice (one: the new fragment, two: the older fragment) in the final file. The final file is crippled and unusable. That can't be the answer the problem mentionned in the Jira ticket.

As far as I know, this patch has been active on 4-5 different hosts for a week and encountered no problem so far. RSpec tests seems to confirm that also. Puppet version is 3.7.5 open-source.

@bmjen
Copy link
Contributor

bmjen commented Jul 30, 2015

@j-vizcaino the title is misleading. The root cause of the problem can be read towards the bottom of the comments list.

https://tickets.puppetlabs.com/browse/MODULES-1700?focusedCommentId=159006&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-159006

So, concat::backup currently defaults to 'puppet' so that the original file can be backed up when it is changed, but the design of concat's backup logic was to eliminate fragments from each being backed up as they are unneeded normally.
When combined with the static compiler and concat::fragment resources using the source attribute, the backup parameter not being applied to the fragments appears to be the problem.

jhoblitt added a commit that referenced this pull request Jul 30, 2015
Excluding the merge/revert of #359 on the 1.2.x branch from mergeback
into master.
@LukasAud LukasAud added the bugfix label Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants