1. 10 Nov, 2023 3 commits
    • Nils Goroll's avatar
      Sort prios table · b6d9a9ba
      Nils Goroll authored
      b6d9a9ba
    • Nils Goroll's avatar
      Rename allocation priorities, Raise logblk (dsk) priority by one · 7c72a2e0
      Nils Goroll authored
      it is more important than objects
      
      Should also contribute to a fix for #28
      7c72a2e0
    • Nils Goroll's avatar
      Allocate additional log blocks early · 98e78f01
      Nils Goroll authored
      This, hopefully, is part of a possible solution to the nasty issue #28:
      
      When we do not have a sufficiently large pre-allocated log (log region)
      as determined by objsize_hint in relation to the storage size, we need
      to dynamically allocate disk blocks while we flush the log.
      
      When the log flush includes object deletions (in particular when
      triggered from the disk LRU), we run into a typical deadlock: To
      complete the transaction to free space, we need the space...
      
      This commit is part of an attempt to make this work by allocating
      space early on: When we only have 20% of the log region left, we start
      to reserve more blocks for the log.
      
      The problem can, for example, be reproduced with an objsize_hint of 1MB
      and an actual object size in the oder of 32KB.
      
      Ref #28
      98e78f01
  2. 09 Nov, 2023 1 commit
    • Nils Goroll's avatar
      Fix wrong assertion hitting when all discard methods fail · e7999e0a
      Nils Goroll authored
      Manually tested with this modification:
      
      diff --git a/src/fellow_log.c b/src/fellow_log.c
      index 6075d81..45da269 100644
      --- a/src/fellow_log.c
      +++ b/src/fellow_log.c
      @@ -1696,6 +1696,9 @@ fellow_io_regions_discard(struct fellow_fd *ffd, void *ioctx,
                      r = fallocate(ffd->fd,
                          FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE,
                          (off_t)todo->offset, (off_t)todo->len);
      +               // XXX TEST
      +               r = 1;
      +               errno = EOPNOTSUPP;
                      if (r == 0) {
                              if ((ffd->cap & FFD_CAN_FALLOCATE_PUNCH_URING) == 0) {
                                      ffd->diag("fellow: fallocate punch"
      
      Fixes #38
      e7999e0a
  3. 07 Nov, 2023 5 commits
    • Nils Goroll's avatar
      fellow_stream_f(): Improve comment and assertion · 3fccc602
      Nils Goroll authored
      to make clear that we understand exactly what is happening.
      3fccc602
    • Nils Goroll's avatar
      Fix races for streaming busy objects · a1dbf0fe
      Nils Goroll authored
      For streaming busy objects, we basically rely on the varnish-cache
      ObjExtend() / ObjWaitExtend() API to never read past the object: In
      fellow_stream_f(), we always wait for more data (or the end of the
      object) before returning, such that fellow_cache_obj_iter(), which
      iterates over segments, should never touch a segment past the final
      FCS_BUSY segment.
      
      Yet - it did, by means of the read-ahead and the peek-ahead to determine
      whether or not OBJ_ITER_END should be signaled.
      
      We fix this issue by reading/peeking ahead only for segments with a
      state beyond FCS_BUSY.
      
      There is now also extensive test infrastructure to specifically test
      concurrent access ti busy objects. To keep layers separate,
      fellow_cache_test uses a lightweight signal/wait implementation
      analogous to the ObjExtend() / ObjWaitExtend() Varnish-Cache
      interface.
      
      An earlier version of t_busyobj() had run on my dev laptop for 3.5
      hours without crashing, while without the fixes it had run into
      assertion failures within seconds.
      
      Fixes #35 and #36 (I hope)
      a1dbf0fe
    • Nils Goroll's avatar
      Extend b62.vtc by cache reload · 79ed0dab
      Nils Goroll authored
      79ed0dab
    • Nils Goroll's avatar
      Mark a question to revisit later · 6fff4eed
      Nils Goroll authored
      6fff4eed
    • Nils Goroll's avatar
      Add DBG() to fcsc_next() · fbbcb962
      Nils Goroll authored
      ... to make it easier to follow the code in fellow_cache_test
      
      motivated by #35
      fbbcb962
  4. 03 Nov, 2023 7 commits
  5. 02 Nov, 2023 1 commit
  6. 01 Nov, 2023 2 commits
    • Nils Goroll's avatar
      Polish: use seq_inc() macro · cf06a81f
      Nils Goroll authored
      cf06a81f
    • Nils Goroll's avatar
      Workaround for Varnish-Cache VC#4013: Wrong trim use, inefficient copy · ed0bbf80
      Nils Goroll authored
      https://github.com/varnishcache/varnish-cache/pull/4013 fixes two
      issues in Varnish-Cache, which are relevant for SLASH/fellow and of
      which the first is the root cause of #33.
      
      This commit works around these issues until the fix gets merged:
      
      Because of the wrong use of the .objtrimstore API function by
      varnish-cache, we remove it from our obj_methods and exploit the fact
      that varnish-cache always sets the OA_LEN attribute when the object is
      complete: We move the trimstore function there, effectively calling it
      at the right time only.
      
      The inefficient memory allocation fixed in the second commit of
      VC#4013 is particularly relevant for fellow, because it causes the
      allocation code to assume that the object might grow up to the maximum
      possible size, which causes a substantial over-allocation. We work
      around this issue for the case that a 304 copy is made from fellow to
      fellow by using private thread-local storage to emulate basically the
      same function as the #4013 fix.
      
      Closes #33
      Ref https://github.com/varnishcache/varnish-cache/pull/4013
      ed0bbf80
  7. 31 Oct, 2023 4 commits
  8. 30 Oct, 2023 5 commits
  9. 29 Oct, 2023 1 commit
    • Nils Goroll's avatar
      In forkrun(), fix SIGCHLD waiting and test it · f711a1d5
      Nils Goroll authored
      Spotted by Thomas Gleixner <tglx@linutronix.de>, THANK YOU
      
      forkrun() never properly handled the case that a child exited before
      the timeout expired, because we had failed to block the signal and
      hence never received a SIGCHLD. This was overlooked because this
      functionality was never relevant (it only delayed test execution) and
      because we did not explicitly test it.
      
      Related to #31
      f711a1d5
  10. 27 Oct, 2023 1 commit
  11. 26 Oct, 2023 2 commits
  12. 24 Oct, 2023 8 commits