From: david-sarah Date: Tue, 24 Jul 2012 03:40:06 +0000 (+0000) Subject: interfaces.py: corrections to take into account that lease cancel secrets are no... X-Git-Tag: allmydata-tahoe-1.10a1~60 X-Git-Url: https://git.rkrishnan.org/pf/content/%22file:/about.html?a=commitdiff_plain;h=5105448421cd94a1a90a5e8dce6878841662df9b;p=tahoe-lafs%2Ftahoe-lafs.git interfaces.py: corrections to take into account that lease cancel secrets are no longer honoured. --- diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py index 9e1e99c2..7d0e61db 100644 --- a/src/allmydata/interfaces.py +++ b/src/allmydata/interfaces.py @@ -26,9 +26,10 @@ URIExtensionData = StringConstraint(1000) Number = IntegerConstraint(8) # 2**(8*8) == 16EiB ~= 18e18 ~= 18 exabytes Offset = Number ReadSize = int # the 'int' constraint is 2**31 == 2Gib -- large files are processed in not-so-large increments -WriteEnablerSecret = Hash # used to protect mutable bucket modifications -LeaseRenewSecret = Hash # used to protect bucket lease renewal requests -LeaseCancelSecret = Hash # used to protect bucket lease cancellation requests +WriteEnablerSecret = Hash # used to protect mutable share modifications +LeaseRenewSecret = Hash # used to protect lease renewal requests +LeaseCancelSecret = Hash # was used to protect lease cancellation requests + class RIBucketWriter(RemoteInterface): """ Objects of this kind live on the server side. """ @@ -107,7 +108,9 @@ class RIStorageServer(RemoteInterface): This secret is generated by the client and stored for later comparison by the server. Each server is given a different secret. - @param cancel_secret: Like renew_secret, but protects bucket decref. + @param cancel_secret: This no longer allows lease cancellation, but + must still be a unique value identifying the + lease. XXX stop relying on it to be unique. @param canary: If the canary is lost before close(), the bucket is deleted. @return: tuple of (alreadygot, allocated), where alreadygot is what we @@ -138,8 +141,8 @@ class RIStorageServer(RemoteInterface): For mutable shares, if the given renew_secret does not match an existing lease, IndexError will be raised with a note listing the server-nodeids on the existing leases, so leases on migrated shares - can be renewed or cancelled. For immutable shares, IndexError - (without the note) will be raised. + can be renewed. For immutable shares, IndexError (without the note) + will be raised. """ return Any() @@ -188,7 +191,9 @@ class RIStorageServer(RemoteInterface): This secret is generated by the client and stored for later comparison by the server. Each server is given a different secret. - @param cancel_secret: Like renew_secret, but protects bucket decref. + @param cancel_secret: This no longer allows lease cancellation, but + must still be a unique value identifying the + lease. XXX stop relying on it to be unique. The 'secrets' argument is a tuple of (write_enabler, renew_secret, cancel_secret). The first is required to perform any write. The