• Vladimír Čunát's avatar
    cache: rework reusing transactions (LMDB) · e2621d92
    Vladimír Čunát authored
    Previously a read transaction could be held open by each fork
    indefinitely.  That was done for better speed, but it had a downside
    of keeping old pages alive and potentially reading only old data,
    until some writes were attempted by that fork.
    
    Now kr_cache_ provides explicit API for suitable points where to break
    transactions, reusing the _sync command.  On LMDB side the read-only
    transaction is only reset and later renewed, supposedly giving better
    performance than aborting (see LMDB docs on reset+renew).
    
    Performance: preliminary testing with two forks, resperf on comcast
    query-set shows no noticeable difference in peak QPS.
    e2621d92