old helper vs new client: sharemap is messed up #609
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
1 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#609
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
UploadResults.sharemap
field was changed recently, from being a mapping of shnum-to-peerid into a mapping of shnum-to-set-of-peerids. The allmydata.com helpers are still running the old code (which produces shnum-to-peerid mappings), so when they are used by a new client (which expects shnum-to-set mappings), the client will display the sharemap incorrectly.Those new clients will display a 20-ish long list of 2-character "peerid" strings, whereas they should really be listing a single 8-character long peerid.
Since this is a version skew problem, I'm not sure how to best fix it. The new shnum-to-set mapping is arguably the more correct one, so I'd like to find a way to stick with the new format. This field isn't very important, it's just used for debugging, so we may just be able to ignore it.
Hm, I should have made the comment in UploadResults more specific.. the entire body of
UploadResults
is an external interface, not just thetypeToCopy
string, so any changes that are made to it should be done in a backwards-compatible fashion.Here's an example of what a new (trunk) client's upload/download results show when used against an old (1.2.0) helper:
I'm not sure why it says "Storage Index: (None)", that may be an unrelated
bug.
I want to look at this briefly before 1.3.0 is tagged.. we might want to change the code to make it more compatible. I'll try to finish this monday morning.
The compatibility matrix to pay attention to is:
The current code causes B (old helper, new client) to display a mangled
sharemap (list of tiny strings), and C (new helper, old client) to show a
differently mangled sharemap
(
set(['\x1b\x1a\xa2\xbaE\xd8\x07\xf2\xb6N\x1eC\x7f\xc5X\x8d?\x96\xa8\xde'])
).So, the way I see it, we've got three options:
single string (well, a dict mapping share number to a single string).
This is the only option which will fix the C (new helper, old client) case
UploadResults
structure, change theclient to look for the version number, treat a missing version number as
"version 0", translate version 0 sharemap attributes from a single string
to a one-element set of strings. This will fix B but leave C broken. An
alternative implementation would be to modify the client code to accept
either a single string or a set of strings.
Eh, alright, it's not that big a deal. I'll implement the alternate form of
3, by making the client code accept either a single string or a set of
strings.
sigh, it's weirder than that.
The old helper, when the file was already found in the grid (i.e. if there
were N distinct shares), returns an upload_results.sharemap that has a
mapping from shnum to a human-readable string: "
Found on shortpeerid1,shortpeerid2..
". If the file needed to be uploaded, itreturns the same sharemap that upload produces.
The 1.2.0 uploader sharemap looks like:
peer-selection phase, the values are a human-readable string "
Found on shortpeerid
" (indicating only the last-queried server)previously found on some other server), the value is a human-readable
string "
Placed on shortpeerid
".The 1.2.0 web "upload status" page just dumps the sharemap values out to
html, rather than trying to interpret them in any way.
The servermap is less human-readable and more consistently machine-readable,
and the web status page for it does more formatting and interpretation.
The helper code was not changed significantly, but the upload code changed
the way it produces the sharemap: now the sharemap only contains data for
newly-uploaded shares (and does not contain information about pre-existing
shares), and the sharemap values are a set of binary peerids (instead of a
human-readable string). As a result, the helper-generated sharemap might have
values which are either human-readable
Found on x,y,z
(for files thatare already healthy in the grid), or a set of binary peerids.
So I think what needs to happen is that the helper must change to produce a
set of binary peerids, and the client-side uploader should look carefully at
the sharemap it gets back from the helper and simply delete it if it's in the
old (human-readable) format. We could conceivably try to parse the "Placed
on../Found on.." strings, but it may be easier to just pretend the old
sharemaps don't exist.
changeset:a5ab6c060df282ea fixes this, by detecting old helper
UploadResults
(by virtue of having string values) and ignoring them altogether (setting .sharemap=None). The "C" old-client/new-helper direction is still mangled, but at least it doesn't cause a crash.In the future, we need to be more careful about these compatibility boundaries.