Jira (PUP-10675) ensure pluginsync is atomic
Title: Message Title Ciprian Badescu updated an issue Puppet / PUP-10675 ensure pluginsync is atomic Change By: Ciprian Badescu Epic Link: PUP-11032 Add Comment This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.372140.1600258409000.61857.1624348320082%40Atlassian.JIRA.
Jira (PUP-10675) ensure pluginsync is atomic
Title: Message Title Ciprian Badescu updated an issue Puppet / PUP-10675 ensure pluginsync is atomic Change By: Ciprian Badescu Sprint: ready for triage Add Comment This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.372140.1600258409000.61855.1624348260030%40Atlassian.JIRA.
Jira (PUP-10675) ensure pluginsync is atomic
Title: Message Title Bogdan Irimie updated an issue Puppet / PUP-10675 ensure pluginsync is atomic Change By: Bogdan Irimie Sprint: ready for triage Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.372140.1600258409000.72442.1604566322808%40Atlassian.JIRA.
Jira (PUP-10675) ensure pluginsync is atomic
Title: Message Title Bogdan Irimie updated an issue Puppet / PUP-10675 ensure pluginsync is atomic Change By: Bogdan Irimie Sprint: Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.372140.1600258409000.72337.1604566261035%40Atlassian.JIRA.
Jira (PUP-10675) ensure pluginsync is atomic
Title: Message Title Mihai Buzgau updated an issue Puppet / PUP-10675 ensure pluginsync is atomic Change By: Mihai Buzgau Story Points: 5 Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.372140.1600258409000.41085.1600848780029%40Atlassian.JIRA.
Jira (PUP-10675) ensure pluginsync is atomic
Title: Message Title Mihai Buzgau updated an issue Puppet / PUP-10675 ensure pluginsync is atomic Change By: Mihai Buzgau Sprint: PR - Triage Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.372140.1600258409000.41083.1600848480032%40Atlassian.JIRA.
Jira (PUP-10675) ensure pluginsync is atomic
Title: Message Title Josh Cooper updated an issue Puppet / PUP-10675 ensure pluginsync is atomic Change By: Josh Cooper Team: Night's Watch Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.372140.1600258409000.37758.1600292340036%40Atlassian.JIRA.
Jira (PUP-10675) ensure pluginsync is atomic
Title: Message Title Ciprian Badescu updated an issue Puppet / PUP-10675 ensure pluginsync is atomic Change By: Ciprian Badescu There are various scenarios in which catalog and plugins may not match: - plugins are sync-ed while new catalog cannot be retrieved and cached catalog is used instead (this should be subject of https://tickets.puppetlabs.com/browse/PUP-10648 and https://tickets.puppetlabs.com/browse/PUP-10667) - plugins are partially sync-ed, using new or cached catalog may both lead to inconsistenciesTo fix this plugins need to be downloaded in an atomic way. One option is to create a secure directory with the same parent as Puppet[:libdir] and use it to pluginsync. To avoid downloading files we already have, you'd have to copy everything from Puppet[:libdir] to libnew. So maybe something like:1. create lib.new using ruby equivalent of mktemp -d lib.new and restrict permissions so only the current user can write2. Pluginsync to lib.new3. Rename Puppet[:libdir] to lib.old4. Rename lib.new to Puppet[:libdir]5. Delete lib.old recursivelyIt's possible for puppet to crash/ctrl-c between any of those points. If it occurs between 3 and 4, then puppet will have lost all of its plugins. To account for that, if puppet starts and lib.old exists, but Puppet[:libdir] doesn't, then have recover its plugins by renaming lib.old to Puppet[:libdir].If the crash occurs between 4 and 5, then the new plugins have been committed. So when puppet starts, if Puppet[:libdir] exists, have it delete the stale lib.old. Add Comment
Jira (PUP-10675) ensure pluginsync is atomic
Title: Message Title Ciprian Badescu created an issue Puppet / PUP-10675 ensure pluginsync is atomic Issue Type: Bug Assignee: Unassigned Created: 2020/09/16 5:13 AM Priority: Normal Reporter: Ciprian Badescu There are various scenarios in which catalog and plugins may not match: plugins are sync-ed while new catalog cannot be retrieved and cached catalog is used instead plugins are partially sync-ed, using new or cached catalog may both lead to inconsistencies To fix this plugins need to be downloaded in an atomic way. One option is to create a secure directory with the same parent as Puppet[:libdir] and use it to pluginsync. To avoid downloading files we already have, you'd have to copy everything from Puppet[:libdir] to libnew. So maybe something like: 1. create lib.new using ruby equivalent of mktemp -d lib.new and restrict permissions so only the current user can write 2. Pluginsync to lib.new 3. Rename Puppet[:libdir] to lib.old 4. Rename lib.new to Puppet[:libdir] 5. Delete lib.old recursively It's possible for puppet to crash/ctrl-c between any of those points. If it occurs between 3 and 4, then puppet will have lost all of its plugins. To account for that, if puppet starts and lib.old exists, but Puppet[:libdir] doesn't, then have recover its plugins by renaming lib.old to Puppet[:libdir]. If the crash occurs between 4 and 5, then the new plugins have been committed. So when puppet starts, if Puppet[:libdir] exists, have it delete the stale lib.old.