Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[9fans] venti block score & type

0 views
Skip to first unread message

John E. Barham

unread,
Dec 11, 2003, 8:28:42 PM12/11/03
to
Am I write in assuming that both the score and type have to match for a
successful venti block read?

Similarly, that attempting to write a block whose score is already in venti,
but with a different type, will fail?

If so, the score is a unique key for a block but the type must always match
for all subsequent references to that block.

John

Russ Cox

unread,
Dec 11, 2003, 10:16:48 PM12/11/03
to
> Am I write in assuming that both the score and type have to match for a
> successful venti block read?

Yes.

> Similarly, that attempting to write a block whose score is already in venti,
> but with a different type, will fail?

No. A new index entry will be written for the new type.

Types are really just to help a little in interpreting the
data. They're almost purely advisory. (Almost, because
the answer to your first question is yes.) Since blocks are
zero-truncated before storing, the zero-length block
might reasonably be interpreted as a data block or as
a pointer block of any depth. Similarly, if I store a file
whose contents are the SHA1 hash of a small file, that
contents will be stored as data, but storing the small file
itself would use the same block as a first-level pointer
block.

Russ

John E. Barham

unread,
Dec 11, 2003, 11:10:39 PM12/11/03
to
> > Similarly, that attempting to write a block whose score is already in
venti,
> > but with a different type, will fail?
>
> No. A new index entry will be written for the new type.
>
> Types are really just to help a little in interpreting the
> data. They're almost purely advisory. (Almost, because
> the answer to your first question is yes.) Since blocks are
> zero-truncated before storing, the zero-length block
> might reasonably be interpreted as a data block or as
> a pointer block of any depth. Similarly, if I store a file
> whose contents are the SHA1 hash of a small file, that
> contents will be stored as data, but storing the small file
> itself would use the same block as a first-level pointer
> block.

So venti stores a list of types written for each score? Thus reading a
block would require that the type be in that list, but writing a block would
add the type to the list if it was not already present?

John

Russ Cox

unread,
Dec 11, 2003, 11:27:40 PM12/11/03
to

Sure, that would be one way.

In the current Venti server, writing a block with
a new type adds a whole new (score, type) index
entry. The index entries only have one type,
not a list.

Russ

0 new messages