From: Brian Warner Date: Wed, 4 Jul 2007 00:38:49 +0000 (-0700) Subject: storageserver: include metadata in the sizelimit, at least after the bucket has been... X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/%22doc.html/something?a=commitdiff_plain;h=a1c97aa0be0125accbce76906c3ec49a874e8d9e;p=tahoe-lafs%2Ftahoe-lafs.git storageserver: include metadata in the sizelimit, at least after the bucket has been closed --- diff --git a/src/allmydata/storageserver.py b/src/allmydata/storageserver.py index c70d113a..5c5601f0 100644 --- a/src/allmydata/storageserver.py +++ b/src/allmydata/storageserver.py @@ -92,7 +92,7 @@ class BucketWriter(Referenceable): pass self.closed = True - self.ss.bucket_writer_closed(self) + self.ss.bucket_writer_closed(self, fileutil.du(self.finalhome)) def str2l(s): """ split string (pulled from storage) into a list of blockids """ @@ -186,8 +186,8 @@ class StorageServer(service.MultiService, Referenceable): return alreadygot, bucketwriters - def bucket_writer_closed(self, bw): - self.consumed += bw.allocated_size() + def bucket_writer_closed(self, bw, consumed_size): + self.consumed += consumed_size del self._active_writers[bw] def remote_get_buckets(self, storage_index): diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py index 4154cbaf..7d02e178 100644 --- a/src/allmydata/test/test_storage.py +++ b/src/allmydata/test/test_storage.py @@ -16,7 +16,7 @@ class Bucket(unittest.TestCase): fileutil.make_dirs(basedir) return incoming, final - def bucket_writer_closed(self, bw): + def bucket_writer_closed(self, bw, consumed): pass def test_create(self):