9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] venti block score & type
@ 2003-12-12  1:22 John E. Barham
  2003-12-12  3:15 ` Russ Cox
  0 siblings, 1 reply; 4+ messages in thread
From: John E. Barham @ 2003-12-12  1:22 UTC (permalink / raw)
  To: 9fans

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] venti block score & type
  2003-12-12  1:22 [9fans] venti block score & type John E. Barham
@ 2003-12-12  3:15 ` Russ Cox
  2003-12-12  4:05   ` John E. Barham
  0 siblings, 1 reply; 4+ messages in thread
From: Russ Cox @ 2003-12-12  3:15 UTC (permalink / raw)
  To: 9fans

> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] venti block score & type
  2003-12-12  3:15 ` Russ Cox
@ 2003-12-12  4:05   ` John E. Barham
  2003-12-12  4:25     ` Russ Cox
  0 siblings, 1 reply; 4+ messages in thread
From: John E. Barham @ 2003-12-12  4:05 UTC (permalink / raw)
  To: 9fans

> > 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] venti block score & type
  2003-12-12  4:05   ` John E. Barham
@ 2003-12-12  4:25     ` Russ Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Russ Cox @ 2003-12-12  4:25 UTC (permalink / raw)
  To: 9fans

> > > 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?

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-12-12  4:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-12  1:22 [9fans] venti block score & type John E. Barham
2003-12-12  3:15 ` Russ Cox
2003-12-12  4:05   ` John E. Barham
2003-12-12  4:25     ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).