[tahoe-lafs-trac-stream] [tahoe-lafs] #671: bring back sizelimit (i.e. max consumed, not min free)

tahoe-lafs trac at tahoe-lafs.org
Thu Aug 22 23:46:50 UTC 2013


#671: bring back sizelimit (i.e. max consumed, not min free)
-------------------------+-------------------------------------------------
     Reporter:  zooko    |      Owner:  markberger
         Type:  defect   |     Status:  new
     Priority:  major    |  Milestone:  1.12.0
    Component:  code-    |    Version:  1.3.0
  nodeadmin              |   Keywords:  usability statistics sftp docs
   Resolution:           |  test-needed
Launchpad Bug:           |
-------------------------+-------------------------------------------------

Comment (by zooko):

 Lets see… currently that is set by [https://github.com/LeastAuthority
 /tahoe-
 lafs/blame/318b34aac6f7780f7d23cdb6ac3f53fcaf2f27dd/src/allmydata/storage/accounting_crawler.py#L104
 accounting_crawler] (see #1835 to make it so the lease gets added into the
 leasedb immediately at the same time as the share is added to the store
 instead of later by a crawler) and I see from
 [https://github.com/LeastAuthority/tahoe-
 lafs/blame/318b34aac6f7780f7d23cdb6ac3f53fcaf2f27dd/src/allmydata/storage/accounting_crawler.py#L39
 elsewhere in accounting_crawler] that it is using the return value from
 [https://github.com/LeastAuthority/tahoe-
 lafs/blame/ce24a56283c715570613a8cf38605e0c83027ad0/src/allmydata/interfaces.py#l491
 the share's get_used_space()].

 Here are the implementations of {{{get_used_space()}}} in the 1819-cloud-
 merge-opensource branch:

 * [https://github.com/LeastAuthority/tahoe-
 lafs/blame/ce24a56283c715570613a8cf38605e0c83027ad0/src/allmydata/storage/backends/null/null_backend.py#L138
 null backend] (returns 0)
 * [https://github.com/LeastAuthority/tahoe-
 lafs/blame/bc2c1c103a1fb798881f31e8bfd2efbe7222500c/src/allmydata/storage/backends/disk/mutable.py#L124
 disk mutable] (calls [https://github.com/LeastAuthority/tahoe-
 lafs/blame/affc9739ec9e83b011a69f8389c5d3552c3b81bd/src/allmydata/util/fileutil.py#L453
 fileutil.get_used_space(filepath)])
 * [https://github.com/LeastAuthority/tahoe-
 lafs/blame/ac74881c27c2be1355c347e459f747eb7150da68/src/allmydata/storage/backends/disk/immutable.py
 disk immutable] (calls
 {{{fileutil.get_used_space(home)+fileutil.get_used_space(finalhome)}}};
 That's interesting! The home/finalhome distinction is that during the
 upload of an immutable file it is written into a location named home, and
 only after the upload is complete is it mv'ed into finalhome)
 * [https://github.com/LeastAuthority/tahoe-
 lafs/blame/eaa6e22358f1fcf924b3b26094029fad14d72df7/src/allmydata/storage/backends/cloud/cloud_common.py
 cloud_common] (returns just the share's size)

 Okay, check out the implementation of {{{fileutil.get_used_space}}}.

 So, in answer to your question:

 > When I write a 1000 byte share, leasedb is reporting the share size to
 be 4098 bytes. Is this the expected behavior?

 Yes. ☺

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/671#comment:18>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list