[OpenAFS] Limit of clones

Tom Keiser tkeiser@sinenomine.net
Thu, 5 Nov 2009 21:59:36 -0500


On Mon, Nov 2, 2009 at 5:14 PM, Steve Simmons <scs@umich.edu> wrote:
>
> On Oct 31, 2009, at 3:42 PM, Derrick Brashear wrote:
>
>> On Sat, Oct 31, 2009 at 11:08 AM, Anders Magnusson <ragge@ltu.se> wrote:
>>>
>>> The manpage for vos clone says there are a maximum of 7 clones using the
>>> namei fileserver.
>>> What is the reason for this limitation?
>>
>> The implementation uses only 3 bits (1 + 2 + 4 = 7)
>>
>> Given that in a classic fileserver, RW, RO, BK, temporary clone = 4,
>> this wasn't really a problem.
>
> We've experimentally verified that you can manually create another three
> clones and all AFS operations continue to work fine.
>

There is an important caveat: the minute you have >=6 clones, there
MUST be (uniq,DV) overlap for every vnode within the VG.  Otherwise,
namei_GetFreeTag() will fail during CopyOnWrite() ops due to running
out of tags (the on-disk representation of the VG tag map is one row
per vnode id, with 5x 3-bit columns per row, where each 3-bit column
is the reference count for a tag; each unique (uniq,DV) tuple maps 1:1
onto a tag).  Hence, the practical limit on clones is five; six or
seven are only ok in a probabilistic sense.  On the other extreme, the
tag map could _technically_ allow up to 35 clones within a VG, so long
as you have at most five extant (uniq,DV) tuples for every vnode, each
referenced by at most seven volumes within the VG.

Cheers,

-Tom