1. 24 Jul, 2023 17 commits
  2. 21 Jul, 2023 7 commits
    • Nils Goroll's avatar
      Limit chunk_bytes more strictly · da63a5b8
      Nils Goroll authored
      The main cause for #11 seems to be that the chunk size in relation to
      the memory cache was too big.
      
      We now clamp it at memsz >> 10 (less than 1/1024 of the memsz).
      
      This can still lead to issues when the memory size is reduced and
      the cache reloaded, but then at least new objects will not compete
      for the available memory.
      da63a5b8
    • Nils Goroll's avatar
      7bc0fc0d
    • Nils Goroll's avatar
    • Nils Goroll's avatar
      Differentiate memory allocation priorities · 4dcda2c0
      Nils Goroll authored
      Fixes #11 I hope
      4dcda2c0
    • Nils Goroll's avatar
      Introduce new priorities · ed28758e
      Nils Goroll authored
      ed28758e
    • Nils Goroll's avatar
      Decide against extending the log at this point - no oa_present yet · 7125d0c7
      Nils Goroll authored
      With the previous commit, we restore the objcore's oa_present field
      when we first read the object.
      
      On top of that, it would be nice if we could restore the field or at
      least the bit for OA_VARY when we read the log, because a cache lookup
      checks it and could avoid reading objects if the OA_VARY bit is not
      set.
      
      On the other hand, if vary is used, the object needs to be read
      anyway, so restoring oa_present during log read only payed off for no
      vary.
      
      The straight forward solution would be to add 2 bytes to struct
      fellow_dle_obj. This would
      
      - require a DLE version bump and compatibility code
      - bump the dle size from 72 to 80 bytes (because alignment)
      - consequently, reduce FELLOW_DISK_LOG_BLOCK_ENTRIES from 56 to 4032 /
        80 = 50
      
      All this is possible and part of the fellow design, but at
      this point I conclude that it is not worth the effort.
      
      Another option would be to cram two bits into the existing
      fellow_dle_obj, for example by exploiting the fact that the sign bit
      of ban and t_origin is always zero. This could break backwards
      compatibility, so we prepare for the option, but do not implement it.
      
      All in all, we just add a TODO to add this when we need to extend the
      DLE anyway.
      
      Closes #17
      7125d0c7
    • Nils Goroll's avatar
      c40f8bcd
  3. 20 Jul, 2023 2 commits
  4. 15 Jul, 2023 2 commits
  5. 09 Jul, 2023 8 commits
    • Nils Goroll's avatar
      e3a45409
    • Nils Goroll's avatar
      Handle a race between stvfe_mutate() and stvfe_dskoc_fco() · 73ae4228
      Nils Goroll authored
      In stvfe_dskoc_fco() we change the oc's stevedore to memstv only
      _after_ we have taken a refernce via fellow_cache_obj_get() and thus
      potentially put the fco onto the lru list.
      
      This order is important, because other requests racing on
      stvfe_dskoc_fco() need to also go through fellow_cache_obj_get() until
      the memstv object has been established for real.
      
      Yet this opens a window for a window where an fco is on LRU with
      oc->stobj->stevedore still set to dskstv, even without dirty reads,
      and even more so with dirty reads.
      
      Because any additional synchronization here could kill performance, we
      handle this outdated read in stvfe_mutate by not touching the object
      (yet). It will be hit the next time we iterate the LRU list.
      
      Fixes #13, hopefully.
      73ae4228
    • Nils Goroll's avatar
      Refactor local variables in stvfe_mutate() · 51cc35b3
      Nils Goroll authored
      51cc35b3
    • Nils Goroll's avatar
      Revert "Make memstv assertions even more precise" · 49b29e77
      Nils Goroll authored
      Flexelint does not approve of
      
      This reverts commit a1f5225e.
      49b29e77
    • Nils Goroll's avatar
      Make memstv assertions even more precise · a1f5225e
      Nils Goroll authored
      a1f5225e
    • Nils Goroll's avatar
      Make memstv assertions more precise · 3a83052b
      Nils Goroll authored
      Because of #14 I would like to understand if #13 is really a genuine
      bug or some odd consequence
      3a83052b
    • Nils Goroll's avatar
      Start a developer notes document · 72552f52
      Nils Goroll authored
      72552f52
    • Nils Goroll's avatar
      fellow: fini stevedore_priv / call fellow_busy_done() also for objfree · e56ad383
      Nils Goroll authored
      This bug was also present in varnish-cache (will document) and found
      its way into fellow through the api-definition-by-example paradigm of
      varnish-cache:
      
      In varnish-cache vbf_stp_error(), an existing storage object is freed
      to be replaced with a new one, potentially from a different storage
      (usually -sTransient).
      
      In this case, ObjBocDone is not called, because the boc is to be
      preserved - from the client's perspective, the backend transaction is
      still in progress, and the client is waiting for the busy object to
      finish.
      
      At the storage level, however, the process of creation of a new object
      _is_ finished, and any busy object state which the storage might keep
      needs to be finalized.
      
      So, if oc->boc is not NULL for an ObjFreeObj() call, the stevedore
      needs to finish any busy object transaction.
      
      Fixes #14
      e56ad383
  6. 23 Jun, 2023 2 commits
  7. 19 Jun, 2023 1 commit
  8. 17 Jun, 2023 1 commit