Commit Graph

423 Commits

Author SHA1 Message Date
meejah
bf799c1cf8 Merge branch 'master' into 2916.grid-manager-proposal.5
Conflicts:
	src/allmydata/storage_client.py
	src/allmydata/test/common_util.py
2020-12-14 13:44:42 -07:00
Itamar Turner-Trauring
98330d7186 Merge remote-tracking branch 'origin/master' into 3552.test_system-python-3 2020-12-11 13:24:04 -05:00
Itamar Turner-Trauring
9bf221dea4 Match Foolscap better. 2020-12-11 13:10:56 -05:00
Itamar Turner-Trauring
42f2f2318c Fix some Python 3 tests. 2020-12-11 13:05:21 -05:00
Itamar Turner-Trauring
36bf9224e6 More progress on Python 3, unbreak Python 2. 2020-12-10 10:52:07 -05:00
Itamar Turner-Trauring
63ff67a7be Ported to Python 3. 2020-12-09 13:33:01 -05:00
Itamar Turner-Trauring
baed5fd734 Port to Python 3. 2020-12-09 13:22:51 -05:00
Itamar Turner-Trauring
add26895cf Another passing test on Python 3. 2020-12-09 13:11:39 -05:00
Jason R. Coombs
646297ddc3 Add stub for LocalCiphertextReader.set_upload_status 2020-11-29 15:08:46 -05:00
Jason R. Coombs
c3a22966e8 Add stubs for methods demanded by IPeerSelector 2020-11-29 14:52:45 -05:00
Jason R. Coombs
e9ddcf5911 Implement set_size as required by the interface 2020-11-29 14:26:20 -05:00
Jason R. Coombs
7e757d2ec4 As _ImmutableFileNodeBase doesn't implement the interface, move the implementer declaration to LiteralFileNode 2020-11-29 14:23:59 -05:00
Jason R. Coombs
4998c4693f Ignore type checks on Referenceable objects. Ref warner/foolscap#78. 2020-11-29 13:57:46 -05:00
meejah
25ff7c6f55 Merge branch 'master' into 2916.grid-manager-proposal.5 2020-11-13 16:48:14 -07:00
Chad Whitacre
338ee89e63 Stick with unicode (new str) for file path parts
This seems to be the pattern, e.g.:

https://github.com/tahoe-lafs/tahoe-lafs/blob/master/src/allmydata/client.py#L229
2020-10-23 12:52:32 -04:00
Chad Whitacre
725291c2aa Merge branch 'master' into 3468.offloaded-test-coverage 2020-10-23 12:08:48 -04:00
Chad Whitacre
f0657aec69
Merge pull request #853 from tahoe-lafs/3346.port-immutable-offloaded
Port immutable.offloaded to Python 3
2020-10-23 12:05:20 -04:00
Jean-Paul Calderone
a403d25146 Merge remote-tracking branch 'origin/master' into 3468.offloaded-test-coverage 2020-10-16 14:34:35 -04:00
Itamar Turner-Trauring
e6a196c144 Get rid of hopefully unnecessary sort. 2020-10-15 08:33:51 -04:00
Jean-Paul Calderone
5a51d98479 Add missing chk_upload, document two new attrs, and move them up 2020-10-14 10:58:50 -04:00
Jean-Paul Calderone
555b751af0 Further expand existing test coverage by reducing fake quantities
Helper_fake_upload is replaced by more narrowly focused CHKUploadHelper_fake
2020-10-14 10:58:50 -04:00
Jean-Paul Calderone
4e46f9ae12 expand the already-uploaded test for the helper to cover more
shrink the amount of fake code being used and increase the amount of real code
being used
2020-10-14 10:58:50 -04:00
Jean-Paul Calderone
8eb518a221 docstring for Helper._active_uploads 2020-10-14 10:58:50 -04:00
Jean-Paul Calderone
c88c2846e2 Point folks at docs for this 2020-10-14 10:58:50 -04:00
Chad Whitacre
574c63d350 Port immutable.offloaded to Python 3 2020-10-12 07:25:44 -04:00
Itamar Turner-Trauring
17f0676b3f
Merge branch 'master' into 3459.test-checker-python-3 2020-10-09 10:22:17 -04:00
Itamar Turner-Trauring
d519d4b2fa
Merge branch 'master' into 3463.more-immutable-python-3 2020-10-07 13:22:04 -04:00
Itamar Turner-Trauring
72cc37bb95
Merge pull request #843 from tahoe-lafs/3458.callremote-unicode
Fix callRemote unicode issues on Python 2 universally, using monkeypatching

Fixes ticket:3458
2020-10-07 13:21:19 -04:00
Itamar Turner-Trauring
5b76bf7f44 Fix trailing whitespace. 2020-10-07 10:12:31 -04:00
Itamar Turner-Trauring
f2e5688723 Port to Python 3. 2020-10-07 10:06:02 -04:00
Itamar Turner-Trauring
af95769927 Merge branch '3458.callremote-unicode' into 3463.more-immutable-python-3 2020-10-07 09:53:30 -04:00
Itamar Turner-Trauring
9dc4f98987 Port to Python 3. 2020-10-07 09:29:41 -04:00
Itamar Turner-Trauring
3e87ba368e Port to Python 3. 2020-10-06 11:32:19 -04:00
Itamar Turner-Trauring
f8f8329d70 More passing tests on Python 3. 2020-10-02 10:48:54 -04:00
Itamar Turner-Trauring
1088e5368d A little progress on passing tests. 2020-10-02 10:42:44 -04:00
Itamar Turner-Trauring
ade4a5a543 As far as I can tell, none of the IServer implementations actually implement comparison methods. 2020-10-02 10:42:32 -04:00
meejah
9c89100f6d Merge master 2020-10-01 19:04:01 -06:00
Itamar Turner-Trauring
5899cfdabd Fix callRemote unicode issues on Python 2 universally, using monkeypatching. 2020-10-01 10:48:09 -04:00
Itamar Turner-Trauring
2fae4b06bf Fix Python 2 tests. 2020-09-30 14:12:48 -04:00
Itamar Turner-Trauring
4051a17313 Merge remote-tracking branch 'origin/master' into 3453.downloader-share-python-3 2020-09-30 13:28:18 -04:00
Itamar Turner-Trauring
6c72c8b77f Merge branch '3451.immutable-downloader-start-python-3' into 3452.immutable-downloader-more-python-3 2020-09-30 11:52:37 -04:00
Itamar Turner-Trauring
d797ca1162 Merge remote-tracking branch 'origin/master' into 3451.immutable-downloader-start-python-3 2020-09-30 11:42:58 -04:00
Itamar Turner-Trauring
206f25d87e Port to Python 3. 2020-09-29 13:50:59 -04:00
Itamar Turner-Trauring
9eb6241c0a Fix lint. 2020-09-29 13:46:36 -04:00
Itamar Turner-Trauring
2a1e108722 Port to Python 3. 2020-09-29 11:29:49 -04:00
Itamar Turner-Trauring
867a1b71a1 Ported to Python 3. 2020-09-29 11:22:52 -04:00
Itamar Turner-Trauring
1fa724899b Port to Python 3. 2020-09-29 11:04:14 -04:00
Itamar Turner-Trauring
f42634cfe7 Port to Python 3. 2020-09-28 16:51:29 -04:00
Itamar Turner-Trauring
e3a9f5fa75 Test and bugfix for LiteralFileNode equality. 2020-09-28 16:49:30 -04:00
Itamar Turner-Trauring
66c6522325 Unused code. 2020-09-28 16:44:50 -04:00
Itamar Turner-Trauring
5e6201aede
Merge pull request #833 from tahoe-lafs/3446.test-helper-python-3
Port test_helper.py to Python 3

Fixes ticket:3446
2020-09-28 11:35:15 -04:00
Itamar Turner-Trauring
565c48045e Closer to passing tests. 2020-09-25 13:28:59 -04:00
Itamar Turner-Trauring
47aa724c42 Merge remote-tracking branch 'origin/master' into 3439.test-download-python-3 2020-09-25 13:16:12 -04:00
Itamar Turner-Trauring
5cd00d6f2e And even more tests passing in Python 3. 2020-09-24 10:55:47 -04:00
Itamar Turner-Trauring
6fe68c792c Tests pass on Python 2 and 3. 2020-09-21 13:21:19 -04:00
Itamar Turner-Trauring
125a6855d6 More progress towards test_upload on Python 3. 2020-09-21 13:21:19 -04:00
Itamar Turner-Trauring
139bcb1500
Merge pull request #814 from tahoe-lafs/3419.test-encode-python-3-trying-again
Port test_encode to Python 3

Fixes ticket:3419
2020-09-21 11:52:34 -04:00
Itamar Turner-Trauring
7c6e3104ac
Merge pull request #812 from tahoe-lafs/3416.test-encode-python-3
Port allmydata.test.no_network to Python 3

Fixes ticket:3416
2020-09-21 11:51:34 -04:00
Itamar Turner-Trauring
c3bb367a93 Tests pass on Python 3. 2020-09-18 14:31:23 -04:00
Itamar Turner-Trauring
cb24c3eccf Merge branch '3416.test-encode-python-3' into 3419.test-encode-python-3-trying-again 2020-09-18 13:38:44 -04:00
Itamar Turner-Trauring
a0ff941fff Try to fix Python 3 again. 2020-09-18 13:36:54 -04:00
Itamar Turner-Trauring
7b302871e4 Python 2 tests pass again. 2020-09-18 11:41:28 -04:00
Itamar Turner-Trauring
498e69c72e Some progress. 2020-09-16 14:57:55 -04:00
Itamar Turner-Trauring
985e8a0244 More Python 3 changes. 2020-09-16 11:21:17 -04:00
Itamar Turner-Trauring
7d8320b843 Python 3 fixes. 2020-09-16 11:13:23 -04:00
Jason R. Coombs
5a40bf47f4 Convert print statements to print functions, even when commented. Fixes #3408. 2020-09-11 14:50:44 -04:00
Itamar Turner-Trauring
6007c1f67f Some tests are passing. 2020-08-27 15:36:54 -04:00
Itamar Turner-Trauring
c3494f1356 Enough changes to make allmydata.test.test_storage run on Python 3.
Still lots of failures, of course.
2020-08-27 15:19:49 -04:00
Itamar Turner-Trauring
a758f32edf Try to make test_storage import on Python 3. 2020-08-26 10:53:02 -04:00
Itamar Turner-Trauring
504258622c Docstring. 2020-08-11 14:54:12 -04:00
Itamar Turner-Trauring
d8f74770eb Port to Python 3. 2020-08-06 16:38:19 -04:00
Itamar Turner-Trauring
77ae087c77 Remove a2b_l and b2a_l from public API, to ease likely future switch to stdlib
base64's implementation.
2020-07-13 16:12:53 -04:00
meejah
60fea95e23 Merge branch 'master' into 2916.grid-manager-proposal.5 2020-05-07 18:58:55 -06:00
meejah
5633f3a8ff bytes 2019-06-25 14:35:25 -06:00
meejah
310fb60247 move AES to a helper-function style 2019-06-17 15:54:46 -06:00
heartsucker
008825b0fd replaced referecnes to pycryptopp AES with own wrapper 2019-06-13 22:18:55 -06:00
Jean-Paul Calderone
72cf590320 Use IStorageServer instead of RemoteReference in a lot of places 2019-05-31 13:41:07 -04:00
meejah
ee3e1cbcf2 wip; updates to grid-manager impl 2019-05-30 16:01:45 -06:00
tpltnt
c8f11dc2d3 ported old-style classes to new-style 2019-05-26 08:28:18 +02:00
heartsucker
a087a5be72
removed tuple unpacking in function definitons for python3 compatibility 2019-04-18 13:37:18 +02:00
Jean-Paul Calderone
c0e91814d7
Merge pull request #594 from tahoe-lafs/3023.some-immutable-upload-eliot-logging
Add some immutable upload eliot logging

Fixes: ticket:3023
2019-04-05 07:36:48 -04:00
Jean-Paul Calderone
552459b6a3 remove unused import 2019-04-04 19:45:31 -04:00
heartsucker
0750dbac38
updated all python files to use pep-3110 exception syntax for python3 compatibility 2019-04-04 11:57:58 +02:00
Jean-Paul Calderone
3c44cb65a9 add logging around peer selection and upload 2019-04-03 10:32:04 -04:00
Jean-Paul Calderone
83b520bd68 Log a couple of calls on the Encoder 2019-04-03 08:46:22 -04:00
heartsucker
dbfcf8ae00
replaced StringIO imports with six.moves 2019-03-28 12:31:37 +01:00
Jean-Paul Calderone
87daa3ec5a Remove dead debug logging code. 2018-04-26 15:32:02 -04:00
Jean-Paul Calderone
7609fd1861 Remove impossible third codepath 2018-04-26 15:09:01 -04:00
Brian Warner
da4e7dcfbe hush a bunch of not-really-problems caught by the lgtm.com static analyzer
This is all minor stuff: unreachable debug code (that should be commented-out
instead of in an 'if False:' block), unnecessary 'pass' and 'global'
statements, redundantly-initialized variables. No behavior changes. Nothing
here was actually broken, it just looked suspicious to the static analysis at
https://lgtm.com/projects/g/tahoe-lafs/tahoe-lafs/alerts/?mode=list .
2017-12-31 00:19:41 +01:00
meejah
05f48c3601 Various cleanups, fixes and improvements
Squashed all commits that were meejah's between
30d68fb499f300a393fa0ced5980229f4bb6efda
and
33c268ed3a8c63a809f4403e307ecc13d848b1ab
On the branch meejah:1382.markberger-rewrite-rebase.6 as
per review
2017-06-05 16:31:41 -06:00
David Stainton
19c5bbb43b Fix test test_lost_servers
Remove old hypothesis tests

Fix allmydata.test.cli.test_cli.Errors.test_get

this was broken due to differing share placements
whereas we need to allow this.

Fix test_5_overdue_immutable

This change makes the test not depend on the value
of PYTHONHASHSEED.

Revert "Fix test_5_overdue_immutable"

This reverts commit 5f3696d9a53e7df8781a2c463c7112282397cd69.

fix test to actually hang the first 5 *servers*

sort keys for stable output

use file-context-managers

remove probably-unneeded assert (that fails sometimes)

another non-deterministic test?
2017-06-05 16:26:46 -06:00
meejah
56f6dbd363 distribute only to read/write peers
correctly calculate happiness

guard with except

fix tests, and happiness calculation

remove debug

fix placements to None

happiness calc shouldn't have to filter None

WIP fixing some tests etc
2017-06-05 16:26:46 -06:00
David Stainton
a611673934 Make a correction to a hypothesis test comment
Comment out all debug print statements

Add hypothesis tests for the old servers of happiness implementation

Attempt to speed up meejah's servers of happiness

WIP

Fix test_calc_happy

WIP
2017-06-05 16:26:46 -06:00
meejah
b6d9945b95 default answer for every share
refactor hypothesis to be 'pytest style' and add another one

get rid of 'shares->set(1 thing)' in generate_mappings return

Add a unittest hypothesis came up with

fix tests since we return peers, not sets-of-1-peer

add more debug

add a unit-test that's like test_problem_layout_ticket_1128

fix bug

add a note

fix utest

unit-test for bigger numbers

re-insert markberger code for testing

results of pairing with david
2017-06-05 16:26:46 -06:00
meejah
ef17ef2c62 fix happiness calculation
unit-test for happiness calculation

unused function

put old servers_of_happiness() calculation back for now

test for calculate_happiness

remove some redundant functions
2017-06-05 16:26:46 -06:00
David Stainton
42011e775d Make correction to docstring for Tahoe2ServerSelector's _handle_existing_response
Add comments 10 and 8 from the servers of happiness spec

Fix bug in _filter_g3 for servers of happiness

Remove usage of HappinessUpload class

here we modifying the PeerSelector class.
we make sure to correctly calculate the happiness value
by ignoring keys who's value are None...

Remove HappinessUpload and tests

Replace helper servers_of_happiness

we replace it's previous implementation with a new
wrapper function that uses share_placement
2017-06-05 16:26:46 -06:00
meejah
adb9a98383 WIP: refactoring (squahshed all meejah's commits) 2017-06-05 16:26:46 -06:00
Mark Berger
17cff7a176 Implements 'Servers of Happiness' algorithm for upload
This is Mark Berger's original commits, from ticket #1382
2017-06-05 16:26:46 -06:00
meejah
49ae2c5eb7 use @implementer instead of implements
Also, derive some more things from 'object'
2017-02-27 11:01:30 -07:00
Brian Warner
54f974d44c make IServer.get_serverid() use pubkey, not tubid
This is a change I've wanted to make for many years, because when we get
to HTTP-based servers, we won't have tubids for them. What held me back
was that there's code all over the place that uses the serverid for
various purposes, so I wasn't sure it was safe. I did a big push a few
years ago to use IServer instances instead of serverids in most
places (in #1363), and to split out the values that actually depend upon
tubid into separate accessors (like get_lease_seed and
get_foolscap_write_enabler_seed), which I think took care of all the
important uses.

There are a number of places that use get_serverid() as dictionary key
to track shares (Checker results, mutable servermap). I believe these
are happy to use pubkeys instead of tubids: the only thing they do with
get_serverid() is to compare it to other values obtained from
get_serverid(). A few places in the WUI used serverid to compute display
values: these were fixed.

The main trouble was the Helper: it returns a HelperUploadResults (a
Copyable) with a share->server mapping that's keyed by whatever the
Helper's get_serverid() returns. If the uploader and the helper are on
different sides of this change, the Helper could return values that the
uploader won't recognize. This is cosmetic: that mapping is only used to
display the upload results on the "Recent and Active Operations" page.
I've added code to StorageFarmBroker.get_stub_server() to fall back to
tubids when looking up a server, so this should still work correctly
when the uploader is new and the Helper is old. If the Helper is new and
the uploader is old, the upload results will show unusual server ids.

refs ticket:1363
2016-08-26 14:29:50 -07:00