TL;DR: tune the test - now it works quite reliably for me,
though it's perhaps not nice.
With 1 MiB cache it's not easy to avoid overflows, as the defaults are
meant for much larger sizes. Normal GC target is to decrease usage
by 10% when above 80% in 100 records per transaction. That just won't
work reliable due to 10% being only 25 pages.
This commit makes the test run GC with more suitable tuning and
frequently pauses kresd to give GC better chance to catch up.
assert(kr_cach:insert(kr_rrset, nil, ffi.C.KR_RANK_SECURE))
end
+ffi.cdef('int usleep(uint32_t usec);') -- at least in current glibc it's always 32-bit
local rr_count = 0
local function gen_batch()
end
end
kr_cach:commit()
+ ffi.C.usleep(15) -- stop *whole process* to give better chance to GC executing
local delay
if math.random(1,4) == 1 then
delay = 1 -- give a chance to DNS resolving
- name: gc
binary: kres-cache-gc
additional:
- - -d
- - "1"
+ # small cache needs shorter RW transactions and larger "percentages"
+ - -l8
+ - -u50
+ - -f20
+ - -d1
- -c
- ../kresd1/
conncheck: False