magic-folder .backup files are wrong #2909
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#2909
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The behavior of producing .backup files is wrong (and I believe the spec is correct). Currently, whenever we decide to download a file, a
.backup
is produced if there was already a file there.But, consider the case where Alice and Bob share a folder, and Alice makes a series of updates to a file
foo
: on the first update, Bob downloads it and writes it; on the second, Bob downloads but already has one so makes afoo.backup
as well; on the third, Bob downloads but already has one and afoo.backup
so producesfoo.conflict
.I'm fairly sure that (amongst other problems) also this conflict-case is wrong: https://github.com/tahoe-lafs/tahoe-lafs/blob/master/src/allmydata/frontends/magic_folder.py#L1279
We just blindly write .backup files all the time (i.e. anything that's downloaded) which is obviously wrong; but the conflicted cases don't seem to follow the spec either..
I think the link in meejah's previous comment was probably to https://github.com/tahoe-lafs/tahoe-lafs/blob/797932244da3036e0dd2463961a30cf2d319d99b/src/allmydata/frontends/magic_folder.py#L1279 (before new changes landed on master).
It looks like the logic has changed since this comment was made. I think meejah fixed the issue in affb80e39e33417abc2935c2da4e577173913f91 (or at least changed the code).
It also looks like the
.backup
logic has changed. Previously, thanks to https://github.com/tahoe-lafs/tahoe-lafs/blob/797932244da3036e0dd2463961a30cf2d319d99b/src/allmydata/frontends/magic_folder.py#L958, any non-conflicted file being written would result in a backup file, including the case described in this ticket's description.However, it looks like meejah fixed this behavior in 47b17876339443145e95081e9581327229a6f064 by removing the
backup_path_u
argument tofileutil.replace_file
. This causesfileutil.replace_file
to not create a backup file. Thus, backups are only created when metadata indicates the new version of the file is a deletion.The merge for this was c9e00a988ae90ad5e63897607c70404974d370b2:
Therefore, closing as fixed.