Re: swap_meta

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Mon, 8 Oct 2001 14:56:21 +0200

 Do we ever use TLV fields past timestamps during swapin time?
 It seems that currently we would load in inconsistent state.
 sfileno and sdirno are unexpected by meta code...

 Shouldn't we use _storeSwapLogData type while storing Meta?
 Would be imo logical to have it as a fixed-size preable to the
 saved object. We could then update it at a time we write clean
 swap.state or replace whenever needed. We would need to trash
 full cache contents when we change meta layout...

 Maybe instead we'd better handle each field separately by TLV?
 Then we can be "backwards compatible" while being free to rewrite
 meta header the way we like, within bounds of its initial size.
 Maybe it even makes sense to reserve some small space for fixed
 sized bits before URL and rest goes in.

 Adding new meta type after changing just StoreEntry layout seems
 not quite right...

On 8 Oct 2001, at 12:45, Henrik Nordstrom <hno@squid-cache.org> wrote:

> You are reading the code correctly, and it is quick and dirty.
> If we change the layout we need to
>
> a) If the on-disk layout needs to be changed a new META type needs to
> be introduced.
>
> b) If possible, mappings should be provided between supported memory
> and disk formats.
>
> > how is saved_object prepended meta header constructed? Via TLV?
> >
> > #define STORE_HDR_METASIZE (4*sizeof(time_t)+2*sizeof(u_short)+sizeof(size_t))
> > T = storeSwapTLVAdd(STORE_META_STD, &e->timestamp, STORE_HDR_METASIZE, T);
> >
> > struct _StoreEntry {
> > hash_link hash; /* must be first */
> > MemObject *mem_obj;
> > RemovalPolicyNode repl;
> > time_t timestamp;
> > time_t lastref;
> > time_t expires;
> > time_t lastmod;
> > size_t swap_file_sz;
> > sfileno swap_filen:25;
> > sdirno swap_dirn:7;
> > u_short refcount;
> > u_short flags;
> > u_short lock_count; /* Assume < 65536! */
> >
> > What are we actually trying to save apart from 4x timestamps?
> > sounds like we tried to save refcount and flags soem time ago,
> > but now?

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Microlink Online
 Tel: 6501 731, Fax: 6501 725
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Mon Oct 08 2001 - 07:03:34 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:26 MST