Ticket #831 (accepted defect)
Bcfg2 should not update mtime on metadata changes
Reported by: | https://www.google.com/accounts/o8/id?id=AItOawlgX-1giylmugdMyws_Brrk63uA_dyfDnU | Owned by: | solj |
---|---|---|---|
Priority: | minor | Milestone: | Bcfg2 1.4.0 Release |
Component: | bcfg2-client | Version: | 1.0 |
Keywords: | chmod chown stat mtime ctime | Cc: | [email protected]… |
Description
When permissions or ownership of a file change, Bcfg2 is not only updating the file metadata, but also the file itself. So an update to the user, for instance, will also cause the entire file to be rewritten. This affects both mtime and ctime.
Note, however, that subsequent Bcfg2 calls will still chmod/chown the file and update the ctime, even though the permissions are the same--but will not actually modify the file.
This is a problem for programs that use mtime to determine whether or not to refresh changes from the disk, and can produce unexpected results.
Attachments
Change History
comment:1 Changed 13 years ago by solj
- Milestone changed from Bcfg2 1.0.x Doc to Bcfg2 1.1.0 Release
comment:2 Changed 13 years ago by solj
- Milestone changed from Bcfg2 1.1.0 Release to Bcfg2 1.1.1 Release (Bugfix)
comment:3 Changed 12 years ago by solj
- Milestone changed from Bcfg2 1.1.1 Release (Bugfix) to Bcfg2 1.1.2 Release (Bugfix)
comment:4 in reply to: ↑ description Changed 12 years ago by solj
- Owner changed from desai to solj
- Status changed from new to accepted
- Milestone changed from Bcfg2 1.1.2 Release (Bugfix) to Bcfg2 1.2.0 Release
Replying to https://www.google.com/accounts/o8/id?id=AItOawlgX-1giylmugdMyws_Brrk63uA_dyfDnU:
When permissions or ownership of a file change, Bcfg2 is not only updating the file metadata, but also the file itself. So an update to the user, for instance, will also cause the entire file to be rewritten. This affects both mtime and ctime.
I think we should be able to fix this by creating file hashes on the server and comparing them to the file contents of the client.
Note, however, that subsequent Bcfg2 calls will still chmod/chown the file and update the ctime, even though the permissions are the same--but will not actually modify the file.
The Installfile method in browser:src/lib/Client/Tools/POSIX.py should only be called when the file is incorrect. I don't see where this could be happening.
comment:5 Changed 12 years ago by solj
- Milestone changed from Bcfg2 1.2.0 Release to Bcfg2 1.2.1 Release (Bugfix)
comment:6 Changed 11 years ago by solj
- Milestone changed from Bcfg2 1.2.1 Release (Bugfix) to Bcfg2 1.3.0 Release
This seems a bit invasive for a bugfix release. Moving to 1.3.
comment:7 Changed 10 years ago by solj
- Cc [email protected]… added
- Milestone changed from Bcfg2 1.3.0 Release to Bcfg2 1.4.0 Release