Jira (PUP-7397) FileBucket should use `Puppet::Util::replace_file` to write contents

1 view
Skip to first unread message

Moses Mendoza (JIRA)

unread,
Mar 23, 2017, 5:45:03 PM3/23/17
to puppe...@googlegroups.com
Moses Mendoza created an issue
 
Puppet / Bug PUP-7397
FileBucket should use `Puppet::Util::replace_file` to write contents
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2017/03/23 2:44 PM
Priority: Normal Normal
Reporter: Moses Mendoza

Per feedback on PR for PUP-1334, https://github.com/puppetlabs/puppet/pull/5704, it would be ideal to use Puppet::Util::replace_file to write the contents file instead of Puppet::FileSystem::open.

Due to PUP-7394 and PUP-7395 doing so at the time of filing this ticket was not optimal, but once those are addressed this change should be made.

See https://github.com/MosesMendoza/puppet/commit/9f1bf4b3a186942439f41a282c57823bae4af5a2 for an implementation

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Moses Mendoza (JIRA)

unread,
Mar 23, 2017, 5:46:02 PM3/23/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Mar 30, 2017, 1:12:02 PM3/30/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Mar 30, 2017, 1:14:02 PM3/30/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Mar 30, 2017, 1:14:03 PM3/30/17
to puppe...@googlegroups.com

Ethan Brown (JIRA)

unread,
May 17, 2017, 1:14:06 PM5/17/17
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Nov 17, 2017, 4:57:03 PM11/17/17
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-7397
 
Re: FileBucket should use `Puppet::Util::replace_file` to write contents

We could implement this in a way that isn't blocked by 7394 and 7395. Just open the contents file in mode 0640 instead of 0440 (since we have to write to it anyways), then after we're done change the mode to 0440 (or leave it writable by owner).

This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Josh Cooper (JIRA)

unread,
Nov 17, 2017, 4:58:04 PM11/17/17
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Fix Version/s: PUP 5.y
Fix Version/s: PUP 5.4.0

Josh Cooper (JIRA)

unread,
Nov 17, 2017, 5:01:03 PM11/17/17
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Acceptance Criteria: We should use Puppet::Util.replace_file when the server writes the contents and paths files in the file bucket. This is best tested by running multiple agents and have them backup the same sets of files concurrently. If we are not atomically updating files, then you should warnings to the effect of "FileBucket got a duplicate file" and "Unable to verify FileBucket backup", and "Existing backup does not match its expected sum"

Josh Cooper (JIRA)

unread,
Nov 20, 2017, 2:06:05 PM11/20/17
to puppe...@googlegroups.com

Jorie Tappa (JIRA)

unread,
Nov 29, 2017, 1:45:02 PM11/29/17
to puppe...@googlegroups.com
Jorie Tappa commented on Bug PUP-7397
 
Re: FileBucket should use `Puppet::Util::replace_file` to write contents

Josh Cooper so is this ticket just a one line fix in file.rb for mode when opening, or is there more to this that I'm missing?

Jorie Tappa (JIRA)

unread,
Nov 29, 2017, 1:45:04 PM11/29/17
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Dec 4, 2017, 6:44:02 PM12/4/17
to puppe...@googlegroups.com

Jorie Tappa (JIRA)

unread,
Dec 7, 2017, 5:07:03 PM12/7/17
to puppe...@googlegroups.com
Jorie Tappa updated an issue
Change By: Jorie Tappa
Sprint: Platform Core  Hopper  KANBAN

Jorie Tappa (JIRA)

unread,
Dec 13, 2017, 4:25:02 PM12/13/17
to puppe...@googlegroups.com
Jorie Tappa updated an issue
Change By: Jorie Tappa
Acceptance Criteria: We should use Puppet::Util.replace_file when the server writes the contents and paths files in the file bucket. This is best tested by running multiple agents and have them backup the same sets of files concurrently.  If we are not atomically updating files, then you  You  should  see  warnings to the effect of "FileBucket got a duplicate file" and  you will never see  "Unable to verify FileBucket backup", and "Existing backup does not match its expected sum"

Jorie Tappa (JIRA)

unread,
Dec 13, 2017, 4:25:03 PM12/13/17
to puppe...@googlegroups.com
Jorie Tappa updated an issue
Change By: Jorie Tappa
Acceptance Criteria: We should use Puppet::Util.replace_file when the server writes the contents and paths files in the file bucket. This is best tested by running multiple agents and have them backup the same sets of files concurrently. You should see warnings to the effect of "FileBucket got a duplicate file" and you  will  should  never see "Unable to verify FileBucket backup", and "Existing backup does not match its expected sum"

Jorie Tappa (JIRA)

unread,
Dec 13, 2017, 5:05:03 PM12/13/17
to puppe...@googlegroups.com
Jorie Tappa updated an issue
Change By: Jorie Tappa
Acceptance Criteria: We should use Puppet::Util.replace_file when While uploading a large file to  the  server writes  filebucket, attempting to retrieve a file with  the  contents and paths files in  same hash from  the  filebucket should not result in partial  file  bucket  content .  This is best tested by running multiple agents and have them backup the same sets of files concurrently.  You should  see warnings to  either get no content, in  the  effect of "FileBucket got  case where it's  a  duplicate  new  file " and , or  you should  never see "Unable to verify FileBucket backup", and "Existing backup does not match its expected sum"  get the complete file in the case where the file was already existing in the filebucket.

Josh Cooper (JIRA)

unread,
Jan 17, 2018, 6:29:04 PM1/17/18
to puppe...@googlegroups.com

Melissa Stone (JIRA)

unread,
Jan 29, 2018, 1:03:02 PM1/29/18
to puppe...@googlegroups.com

Melissa Stone (JIRA)

unread,
Jan 30, 2018, 5:29:03 PM1/30/18
to puppe...@googlegroups.com
Melissa Stone commented on Bug PUP-7397
 
Re: FileBucket should use `Puppet::Util::replace_file` to write contents

I manually verified this code change in both windows and non-windows, and it is behaving as expected

Kenn Hussey (JIRA)

unread,
Feb 5, 2018, 10:32:03 AM2/5/18
to puppe...@googlegroups.com
Kenn Hussey commented on Bug PUP-7397

Jorie Tappa please add release notes for this issue, if needed. Thanks!

This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)
Atlassian logo

Jorie Tappa (JIRA)

unread,
Feb 5, 2018, 2:48:03 PM2/5/18
to puppe...@googlegroups.com
Jorie Tappa updated an issue
Change By: Jorie Tappa
Release Notes Summary: File bucket contents are now atomically updated, this resolves a race condition where retrieving a file from the file bucket could result in retrieving a partial file.
Release Notes: Bug Fix

John Duarte (JIRA)

unread,
Oct 21, 2019, 10:48:07 AM10/21/19
to puppe...@googlegroups.com
John Duarte updated an issue
Change By: John Duarte
QA Risk Assessment: Needs Assessment No Action
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages