mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 13:33:09 +00:00
Punt overlapping writes for now.
This commit is contained in:
parent
b7ae9a675f
commit
460b74e171
@ -211,11 +211,8 @@ class IStorageServerImmutableAPIsTestsMixin(object):
|
|||||||
"""
|
"""
|
||||||
Shares that are fully written to can be read.
|
Shares that are fully written to can be read.
|
||||||
|
|
||||||
1. The result is not affected by the order in which writes
|
The result is not affected by the order in which writes
|
||||||
happened, only by their offsets.
|
happened, only by their offsets.
|
||||||
|
|
||||||
2. When overlapping writes happen, the resulting read returns the
|
|
||||||
latest written value.
|
|
||||||
"""
|
"""
|
||||||
storage_index, renew_secret, cancel_secret = (
|
storage_index, renew_secret, cancel_secret = (
|
||||||
new_storage_index(),
|
new_storage_index(),
|
||||||
@ -241,15 +238,8 @@ class IStorageServerImmutableAPIsTestsMixin(object):
|
|||||||
yield allocated[2].callRemote("write", 0, b"3" * 512)
|
yield allocated[2].callRemote("write", 0, b"3" * 512)
|
||||||
yield allocated[2].callRemote("close")
|
yield allocated[2].callRemote("close")
|
||||||
|
|
||||||
# Bucket 3 has an overlapping write.
|
|
||||||
yield allocated[3].callRemote("write", 0, b"5" * 20)
|
|
||||||
# The second write will overwrite the first.
|
|
||||||
yield allocated[3].callRemote("write", 0, b"6" * 24)
|
|
||||||
yield allocated[3].callRemote("write", 24, b"7" * 1000)
|
|
||||||
yield allocated[3].callRemote("close")
|
|
||||||
|
|
||||||
buckets = yield self.storage_server.get_buckets(storage_index)
|
buckets = yield self.storage_server.get_buckets(storage_index)
|
||||||
self.assertEqual(set(buckets.keys()), {1, 2, 3})
|
self.assertEqual(set(buckets.keys()), {1, 2})
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
(yield buckets[1].callRemote("read", 0, 1024)), b"1" * 512 + b"2" * 512
|
(yield buckets[1].callRemote("read", 0, 1024)), b"1" * 512 + b"2" * 512
|
||||||
@ -257,10 +247,13 @@ class IStorageServerImmutableAPIsTestsMixin(object):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
(yield buckets[2].callRemote("read", 0, 1024)), b"3" * 512 + b"4" * 512
|
(yield buckets[2].callRemote("read", 0, 1024)), b"3" * 512 + b"4" * 512
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
|
||||||
(yield buckets[3].callRemote("read", 0, 1024)),
|
@skipIf(True, "https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3801")
|
||||||
b"6" * 24 + b"7" * 1000,
|
def test_overlapping_writes(self):
|
||||||
)
|
"""
|
||||||
|
The policy for overlapping writes is TBD:
|
||||||
|
https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3801
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
class _FoolscapMixin(SystemTestMixin):
|
class _FoolscapMixin(SystemTestMixin):
|
||||||
|
Loading…
Reference in New Issue
Block a user