commit | 496c1257ad63c2c5dfaeb2f71bcfef226660b4d3 | [log] [tgz] |
---|---|---|
author | Antonio Barone <syntonyze@gmail.com> | Thu Jan 06 22:46:20 2022 +0100 |
committer | Antonio Barone <syntonyze@gmail.com> | Wed Jan 12 14:56:48 2022 +0100 |
tree | 98db9291f02b095c31d44d510783aed4ed70148d | |
parent | eb41be284c11edfaef50868b72a885987d8f8853 [diff] |
Do not throw when failing to store into chronicle-map When storing a new entry in chronicle-map it is possible that the operation might fail. For instance, if the new entry diverges greatly from the configured average key and value size, the available memory chunks might not be enough to accommodate the new entry. Chronicle-map fails with: ``` Entry is too large: requires X chunks, Y is the maximum. ``` Another typical case would be that the cache already reached the maximum number of auto-resizes and thus it is not able to expand anymore. Chronicle-map fails with: ``` Attempt to allocate #X extra segment tier, Y is maximum. ``` In these cases, as well as other possible failures, we don't want the exception to bubble up to the stack and cause the caller to fail. The caller might be a REST API initiated by the UI via ajax, which in turn, would cause the UI to stop rendering and a bad user experience. Catch chronicle-map's `put()` exception locally and simply avoid caching the offending entry. Bug: Issue 15483 Change-Id: Ia1811d66b676388f15cb6f42ef3ee4fd5d1aa94b
Non-blocking and super-fast on-disk cache libModule for Gerrit Code Review based on ChronicleMap on-disk implementation.
This libModule is built like a Gerrit in-tree plugin, using Bazelisk. See the build instructions for more details.
Install the chronicle-map module into the $GERRIT_SITE/lib
directory.
Add the cache-chroniclemap module to $GERRIT_SITE/etc/gerrit.config
as follows:
[gerrit] installModule = com.googlesource.gerrit.modules.cache.chroniclemap.ChronicleMapCacheModule
For further information and supported options, refer to config documentation.
You can check how to migrate from H2 to chronicle-map here.