[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3818: Writing at offset=0 using REST API fails for empty files
Tahoe-LAFS
trac at tahoe-lafs.org
Wed Oct 20 15:32:58 UTC 2021
#3818: Writing at offset=0 using REST API fails for empty files
--------------------------+-----------------------
Reporter: derkades | Owner:
Type: defect | Status: new
Priority: normal | Milestone: undecided
Component: unknown | Version: n/a
Resolution: | Keywords:
Launchpad Bug: |
--------------------------+-----------------------
Description changed by derkades:
Old description:
> Trying to write a single byte at offset 0 to an empty SDMF file:
> {{{
> FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=sdmf')
> curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0" >
> error1.html
> }}}
> or MDMF:
> {{{
> FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=mdmf')
> curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0" >
> error2.html
> }}}
> Please find error files attached.
>
> No offset works:
> {{{
> curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP"
> }}}
> Now that the file contains 1 byte ('a'), we can write at offset=1 to make
> it 2 bytes long ('aa'):
> {{{
> curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=1"
> }}}
> Also overwriting the first byte seems to work, but actually overwrites
> the entire file (unrelated issue?):
> {{{
> curl -X PUT --data b "http://10.0.1.1:26551/uri/$FILE_CAP?offset=1"
> }}}
> The file now contains 'b', while I would expect 'ba'.
New description:
Trying to write a single byte at offset 0 to an empty SDMF file:
{{{
FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=sdmf')
curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0" >
error1.html
}}}
or MDMF:
{{{
FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=mdmf')
curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0" >
error2.html
}}}
Please find error files attached.
No offset works:
{{{
curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP"
}}}
Now that the file contains 1 byte ('a'), we can write at offset=1 to make
it 2 bytes long ('aa'):
{{{
curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=1"
}}}
Also overwriting the first byte seems to work, but actually overwrites the
entire file (unrelated issue?):
{{{
curl -X PUT --data b "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0"
}}}
The file now contains 'b', while I would expect 'ba'.
--
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3818#comment:1>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list