Commit Graph

7793 Commits

Author SHA1 Message Date
Jean-Paul Calderone
0ada9d93f7 remove unused local 2021-10-23 07:43:22 -04:00
Jean-Paul Calderone
470657b337 Drop corruption advisories if we don't have a matching share 2021-10-23 07:35:05 -04:00
Jean-Paul Calderone
21f848f0e3 Merge remote-tracking branch 'upstream/master' 2021-10-23 07:32:26 -04:00
Jean-Paul Calderone
cb675df48d remove unused encoding of storage index 2021-10-22 16:10:24 -04:00
Jean-Paul Calderone
194499aafe remove unused import 2021-10-22 16:09:54 -04:00
Jean-Paul Calderone
6449ad03de Do not record corruption advisories if there is no available space 2021-10-22 15:56:45 -04:00
Jean-Paul Calderone
f789339a79 Have MutableShare file only write a new lease if there is room for it
This is analagous to the earlier ShareFile change.
2021-10-22 15:56:45 -04:00
Jean-Paul Calderone
dd1ab2afe8 Add a helper to compute the size of a lease in a mutable share 2021-10-22 15:56:45 -04:00
Jean-Paul Calderone
e0ed04c103 use SyncTestCase to get expectThat 2021-10-22 15:56:45 -04:00
Jean-Paul Calderone
4defc641a2 Have ShareFile only write a new lease if there is room for it
StorageServer passes available space down so it can make the decision.
ShareFile has to do it because `add_or_renew_lease` only *sometimes* adds a
lease and only ShareFile knows when that is.
2021-10-22 15:56:45 -04:00
Jean-Paul Calderone
1264c3be1e Use _add_or_renew_leases helper consistently in StorageServer
This will make it easier to add a new argument to the underlying
`add_or_renew_lease` call.
2021-10-22 15:56:45 -04:00
Jean-Paul Calderone
b3aa1e224f Add a helper to LeaseInfo for computing size
This lets some code LBYL and avoid writing if the lease won't fit in the
immutable share in the space available.
2021-10-22 15:56:45 -04:00
Jean-Paul Calderone
c774256937 Add a test for `remote_add_lease` with respect to reserved space 2021-10-22 15:56:45 -04:00
Jean-Paul Calderone
82e4704415 Merge remote-tracking branch 'remediate/master' into LFS-01-008 2021-10-22 15:27:15 -04:00
Jean-Paul Calderone
ce30f9dd06 clean up copyediting errors 2021-10-22 15:04:45 -04:00
Jean-Paul Calderone
bb31215134 Merge remote-tracking branch 'remediate/master' into LFS-01-007 2021-10-22 12:35:57 -04:00
Jean-Paul Calderone
d8c466e9a7 try to explain lease_count_format more clearly 2021-10-22 12:35:11 -04:00
Jean-Paul Calderone
a22787e879
Merge pull request #30 from tahoe-lafs/LFS-01-001
Fix item LFS-01-001 from the Cure53 audit

Fixes: ticket:3819
2021-10-22 12:20:38 -04:00
Jean-Paul Calderone
6c0ca0b885 try making windows let us use longer paths 2021-10-22 11:42:13 -04:00
Itamar Turner-Trauring
2a5dbcb05e Tests for mutable leases. 2021-10-19 09:30:38 -04:00
Itamar Turner-Trauring
4b8b6052f3 Finish testing leases on immutables. 2021-10-19 09:05:48 -04:00
Jean-Paul Calderone
3cd9a02c81 Reject negative lengths in MutableShareFile._read_share_data and readv 2021-10-18 20:22:52 -04:00
Jean-Paul Calderone
5e58b62979 Add a test for negative offset or length to MutableShareFile.readv 2021-10-18 20:22:52 -04:00
Jean-Paul Calderone
df64bbb1e4 fail to encode the lease count *before* changing anything
This preserves the failure behavior - `struct.error` is raised - but leaves
the actual share file contents untouched if the new lease count cannot be
encoded.

There are still two separate write operations so it is conceivable that some
other problem could cause `write_lease_record` to happen but
`write_encoded_num_leases` not to happen.  As far as I can tell we have
severely limited options for addressing that problem in general as long as
share files are backed by a POSIX filesystem.

However, by removing the failure mode that depends on user input, it may be
that this is all that is needed to close the *security* hole.
2021-10-18 20:17:41 -04:00
Jean-Paul Calderone
f60bbbd3e2 make it possible to test this behavior of add_lease 2021-10-18 20:17:41 -04:00
Itamar Turner-Trauring
b7be91e3d0 First test for leases. 2021-10-18 13:17:07 -04:00
Itamar Turner-Trauring
2b40610a27 "Server" is extremely ambiguous, so let's just call this a client, which it is. 2021-10-18 12:55:30 -04:00
Itamar Turner-Trauring
58112ba75b Plan of implementation for lease tests. 2021-10-18 12:50:29 -04:00
Jean-Paul Calderone
1c347c5931 replace sensitive introducer fURL with path where it can be found 2021-10-18 08:05:40 -04:00
Jean-Paul Calderone
ad216e0f23 remove unused import 2021-10-15 13:13:37 -04:00
Jean-Paul Calderone
0611af6b0b Stop passing even a dummy value for control tub into Nodes 2021-10-15 13:10:18 -04:00
Jean-Paul Calderone
fe2e2cc1d6 Get rid of the control service 2021-10-15 12:12:19 -04:00
Jean-Paul Calderone
1de480dc37 Stop offering an API to create a control tub or handling the control tub 2021-10-15 12:12:03 -04:00
Jean-Paul Calderone
ddf5f461bf Stop half-pretending to have a control port 2021-10-15 12:11:53 -04:00
Jean-Paul Calderone
e0312eae57 stop creating a control tub for client nodes 2021-10-15 12:02:24 -04:00
Jean-Paul Calderone
95b765e309 stop creating a control tub for the introducer 2021-10-15 11:54:18 -04:00
Itamar Turner-Trauring
e099bc6736 Tests for IStorageServer.advise_corrupt_share. 2021-10-14 12:52:56 -04:00
Itamar Turner-Trauring
22aab98fcf When callRemoteOnly as removed, these probably should've been changed to return
a Deferred.
2021-10-14 12:52:40 -04:00
Jean-Paul Calderone
efc9dc831b Revert "a stab at using setup.cfg and setuptools_scm"
This reverts commit 68e8e0a7d5.
2021-10-14 11:01:37 -04:00
Jean-Paul Calderone
68e8e0a7d5 a stab at using setup.cfg and setuptools_scm 2021-10-14 10:58:41 -04:00
Itamar Turner-Trauring
807363adc9 Reduce duplication. 2021-10-06 16:41:50 -04:00
Itamar Turner-Trauring
3cf09ef888 Merge remote-tracking branch 'origin/master' into 3798-bucket-write-abort-tests 2021-10-06 16:07:39 -04:00
Itamar Turner-Trauring
0a605530d8
Merge pull request #1134 from tahoe-lafs/3793-persistent-bucketwriter
Don't tie BucketWriter lifetime to Foolscap connection lifetime

Fixes ticket:3793
2021-10-06 16:07:17 -04:00
Itamar Turner-Trauring
f3ebc71410
Merge pull request #1133 from tahoe-lafs/3805-istorageserver-tests-slot-readv
IStorageServer tests: slot_readv

Fixes ticket:3805
2021-10-06 15:41:29 -04:00
Itamar Turner-Trauring
bf176144c5 Handle double-disconnect, should it happen by mistake. 2021-10-06 15:18:00 -04:00
Itamar Turner-Trauring
82cbce6b7e Better explanation. 2021-10-06 15:12:22 -04:00
Itamar Turner-Trauring
17a670dfb5 Test for aborting bucket upload. 2021-10-04 10:37:37 -04:00
Itamar Turner-Trauring
b09b7fd01b Merge branch '3793-persistent-bucketwriter' into 3798-bucket-write-abort-tests 2021-10-04 10:30:41 -04:00
Itamar Turner-Trauring
23fd11be43 Expand explanation. 2021-09-29 14:13:18 -04:00
Itamar Turner-Trauring
016d6b4530 Fix spurious type checking error. 2021-09-29 14:10:14 -04:00
Itamar Turner-Trauring
f8604e2394 Fix flakes. 2021-09-29 14:00:11 -04:00
Itamar Turner-Trauring
58d7e2f627 Simplify implementation. 2021-09-29 13:58:53 -04:00
Itamar Turner-Trauring
8fb6afee1b Refactor BucketWriters such that disconnection can be limited Foolscap. 2021-09-29 13:42:17 -04:00
Itamar Turner-Trauring
a4153b7125 Implementation plan. 2021-09-29 11:56:04 -04:00
Itamar Turner-Trauring
51e8b5e197 Disconnection test works now. 2021-09-29 11:17:33 -04:00
Itamar Turner-Trauring
45c564f3c8
Merge pull request #1131 from tahoe-lafs/3797-istorageserver-tests-part-3
IStorageServer tests, part 3: slot_testv_and_writev_and_readv

Fixes ticket:3797
2021-09-29 10:28:42 -04:00
meejah
0a072a98c8
Merge pull request #1125 from hacklschorsch/3786.openmetrics
3786 Add OpenMetrics (Prometheus) statistics endpoint
2021-09-28 13:21:46 -06:00
Itamar Turner-Trauring
e64c397fc5 WIP disconnection test. 2021-09-28 13:51:31 -04:00
Itamar Turner-Trauring
a02d5f4c9c Just stick to current behavior. 2021-09-28 13:02:01 -04:00
Itamar Turner-Trauring
9970559019 Tests for slot_readv. 2021-09-28 10:46:21 -04:00
Itamar Turner-Trauring
fadfbcad99
Merge pull request #1130 from tahoe-lafs/3801-no-overlapping-writes-immutable-upload
Disallow conflicting overlapping writes when doing an immutable upload.

Fixes ticket:3801
2021-09-28 10:37:56 -04:00
Itamar Turner-Trauring
c668e342c2 More STARAW tests. 2021-09-28 09:54:13 -04:00
Itamar Turner-Trauring
914ca56775 TODOs. 2021-09-27 17:05:03 -04:00
Itamar Turner-Trauring
9f80435b41 Update to new interface. 2021-09-27 17:04:22 -04:00
Itamar Turner-Trauring
da363d54de Merge remote-tracking branch 'origin/master' into 3797-istorageserver-tests-part-3 2021-09-27 17:03:05 -04:00
Itamar Turner-Trauring
eb5b6c557e
Merge pull request #1127 from tahoe-lafs/3799-simplify-IStorageServer
Rip out unnecessary operator logic, and simplify IStorageServer

Fixes ticket:3799
2021-09-27 16:57:16 -04:00
Itamar Turner-Trauring
de1a7d7fce A more explicit test for successful overlapping. 2021-09-27 16:56:24 -04:00
Itamar Turner-Trauring
da937cef9e Correct docstring. 2021-09-27 15:04:04 -04:00
Itamar Turner-Trauring
1c10fa8c7f Merge remote-tracking branch 'origin/master' into 3799-simplify-IStorageServer 2021-09-27 15:02:09 -04:00
Itamar Turner-Trauring
b1b64c787e Add more randomness. 2021-09-27 15:00:52 -04:00
Itamar Turner-Trauring
0b1082fc04 Fix lint. 2021-09-24 12:04:12 -04:00
Itamar Turner-Trauring
c1f8e9f8c7 IStorageServer test for overlapping writes. 2021-09-24 12:02:30 -04:00
Itamar Turner-Trauring
6ef3811112 Prevent conflicting overlapping writes. 2021-09-24 11:54:08 -04:00
Itamar Turner-Trauring
1ff4e61e41 Low-level tests for conflicting and non-conflicting writes. 2021-09-24 10:49:27 -04:00
Itamar Turner-Trauring
4f7727df04 Merge remote-tracking branch 'origin/master' into 3795-istorageserver-tests-part-2 2021-09-23 14:20:44 -04:00
Itamar Turner-Trauring
ec6dfb8297 Re-enable test. 2021-09-23 14:20:34 -04:00
Jean-Paul Calderone
2f60ab300b black formatting 2021-09-23 07:48:27 -04:00
Jean-Paul Calderone
4b6d00221e protect this crazy line from black 2021-09-23 07:48:19 -04:00
Jean-Paul Calderone
f66a8ab136 formatting and explicit unicode string literals 2021-09-23 07:43:37 -04:00
Jean-Paul Calderone
cbb96bd57a one more docstring 2021-09-23 07:43:33 -04:00
Jean-Paul Calderone
4d8164773c factor helper function out to top-level 2021-09-23 07:43:18 -04:00
Jean-Paul Calderone
f8c07bfd11 add some docstrings 2021-09-23 07:42:59 -04:00
Jean-Paul Calderone
5e26f25b37 It's ported to Python 3! 2021-09-23 07:41:43 -04:00
Jean-Paul Calderone
c67c0727e6
Merge pull request #1103 from LeastAuthority/3525.test_status-no-mock
Remove usage of mock from allmydata/test/cli/test_status.py

Fixes: ticket:3525
2021-09-22 16:48:34 -04:00
Jean-Paul Calderone
198de5c648 Hoist the sys.stdout import to top level 2021-09-22 15:53:56 -04:00
Itamar Turner-Trauring
b835a671ce Merge remote-tracking branch 'origin/master' into 3795-istorageserver-tests-part-2 2021-09-21 15:09:49 -04:00
Itamar Turner-Trauring
4a9ff82533 Merge remote-tracking branch 'origin/master' into 3799-simplify-IStorageServer 2021-09-21 15:08:42 -04:00
Itamar Turner-Trauring
460b74e171 Punt overlapping writes for now. 2021-09-21 13:29:24 -04:00
Itamar Turner-Trauring
b7ae9a675f Merge remote-tracking branch 'origin/master' into 3784-istorageserver-test-suite 2021-09-21 13:20:53 -04:00
Jean-Paul Calderone
87113d6a13 Merge remote-tracking branch 'origin/master' into 3525.test_status-no-mock 2021-09-20 07:14:02 -04:00
Florian Sesser
e5e0d71ef5 OpenMetrics test suite: More clean ups
trailing whitespace
2021-09-17 13:20:59 +00:00
Florian Sesser
fb0335cc17 OpenMetrics test suite: More clean up
The Linter complains:
> 'testtools.matchers.Always' imported but unused
2021-09-17 12:17:32 +00:00
Florian Sesser
a2378d0e70 OpenMetrics test suite: Make CI happy: No old style objects 2021-09-17 12:04:12 +00:00
Florian Sesser
5825b8bd42 OpenMetrics: rework test suite with exarkun 2021-09-16 15:58:04 +00:00
Itamar Turner-Trauring
e11e5dfbe6 Revert removal of length in IStorageServer. 2021-09-15 16:31:54 -04:00
Itamar Turner-Trauring
1d2073b8f8 Revert "This is unnecessary, empty vector list is fine too."
This reverts commit f109afa3b1.
2021-09-15 16:19:24 -04:00
Florian Sesser
b0e1cf924d OpenMetrics test: White space only: Format JSON fixture to be easier on the eyes 2021-09-15 15:14:29 +00:00
Itamar Turner-Trauring
911a5e2ed1 Rip out server-side usage of operators other than eq, because nothing ever used them. 2021-09-15 11:07:02 -04:00
Itamar Turner-Trauring
f109afa3b1 This is unnecessary, empty vector list is fine too. 2021-09-15 10:51:43 -04:00
Itamar Turner-Trauring
8633432980 Switch IStorageServer interface to be slightly different than RIStorageServer. 2021-09-15 10:33:51 -04:00