Changeset 1e1d24b


Ignore:
Timestamp:
2009-11-18 20:54:32 (4 years ago)
Author:
Poul-Henning Kamp <phk@…>
Branches:
master, 3.0, 4.0, experimental-ims
Children:
c4cd7bd
Parents:
d32a2d8
git-author:
Poul-Henning Kamp <phk@…> (2009-11-18 20:54:32)
git-committer:
Poul-Henning Kamp <phk@…> (2009-11-18 20:54:32)
Message:

Close a race that demonstrates that I have no idea what kind of load
my users have:

Do not load new segments opened after we started, even if multiple such
have been created, before we finish loading the old segments from the
silo.

Fixes #564

git-svn-id:  http://www.varnish-cache.org/svn/trunk/varnish-cache@4355 d4fa192b-c00b-0410-8231-f00ffab90ce4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/varnishd/storage_persistent.c

    r26ff83 r1e1d24b  
    100100        struct smp_segptr       p; 
    101101 
     102        unsigned                must_load; 
     103 
    102104        uint32_t                nobj;           /* Number of objects */ 
    103105        uint32_t                nalloc;         /* Allocations */ 
     
    885887 
    886888        ASSERT_SILO_THREAD(sc); 
    887         (void)sp; 
     889        CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); 
     890        CHECK_OBJ_NOTNULL(sg, SMP_SEG_MAGIC); 
     891        CHECK_OBJ_NOTNULL(sg->lru, LRU_MAGIC); 
     892        assert(sg->must_load == 1); 
     893        sg->must_load = 0; 
    888894        AN(sg->p.offset); 
    889895        if (sg->p.objlist == 0) 
     
    10061012                AN(sg); 
    10071013                sg->lru = LRU_Alloc(); 
     1014                CHECK_OBJ_NOTNULL(sg->lru, LRU_MAGIC); 
    10081015                sg->p = *ss; 
     1016 
     1017                sg->must_load = 1; 
     1018 
    10091019                /* 
    10101020                 * HACK: prevent save_segs from nuking segment until we have 
     
    10531063        AN(sg); 
    10541064        sg->sc = sc; 
     1065        sg->lru = LRU_Alloc(); 
     1066        CHECK_OBJ_NOTNULL(sg->lru, LRU_MAGIC); 
    10551067 
    10561068        AN(sc->objbuf); 
     
    11901202        /* First, load all the objects from all segments */ 
    11911203        VTAILQ_FOREACH(sg, &sc->segments, list) 
    1192                 smp_load_seg(sp, sc, sg); 
     1204                if (sg->must_load) 
     1205                        smp_load_seg(sp, sc, sg); 
    11931206 
    11941207        sc->flags |= SMP_F_LOADED; 
Note: See TracChangeset for help on using the changeset viewer.