error via cache issue

35 views
Skip to first unread message

Guy Levkowitz

unread,
Nov 23, 2025, 3:59:42 AM (5 days ago) Nov 23
to Repo and Gerrit Discussion
Hey

We got below error:
[2025-11-23T01:05:22.940+02:00] [DiskCache-Prune-1[Disk Cache Pruner (gerrit_file_diff-v2)]] INFO  com.google.gerrit.server.cache.h2.H2CacheImpl : Cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2 size (3.54g) is greater than maxSize (128.00m), pruning
[2025-11-23T01:05:25.185+02:00] [DiskCache-Prune-1[Disk Cache Pruner (gerrit_file_diff-v2)]] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot prune cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2
org.h2.jdbc.JdbcSQLTimeoutException: Timeout trying to lock table {0}; SQL statement:
DELETE FROM data WHERE k=? and version=? [50200-232]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:572)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)



Also 
[2025-11-23T09:28:53.833+02:00] [HTTP GET /a/changes/?q=%28+commit%3A345e5ea204f7d9bb314157935450f742d3421a85+OR+commit%3A4afed833b1a4f167d2258b8dc5142be (SELF_REVIEW from 192.168.121.52)] WARN com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot read cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2 for FileDiffCacheKey{project=os_sed, oldCommit=commit 5129bfa498d62d2f7e35e3f4d24d93587456f2c3 0 -------, newCommit=AnyObjectId[4521173b650c2cac27f9bcf4d389e6f1227a31cb], newFilePath=module.conf, renameScore=60, diffAlgorithm=HISTOGRAM_WITH_FALLBACK_MYERS, whitespace=IGNORE_NONE, useTimeout=true} [CONTEXT TRACE_ID="1763882823320-d57d341b" request="REST /changes/" ]
org.h2.jdbc.JdbcSQLTimeoutException: Timeout trying to lock table "DATA"; SQL statement:
UPDATE data SET accessed=? WHERE k=? AND version=? [50200-232]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:572)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)

what should we redefine in the gerrit.config file ? 


BR

Guy

Luca Milanesio

unread,
Nov 23, 2025, 4:54:39 AM (5 days ago) Nov 23
to Repo and Gerrit Discussion, Luca Milanesio
Hi Guy,

On 23 Nov 2025, at 08:59, Guy Levkowitz <sil...@gmail.com> wrote:

Hey

We got below error:
[2025-11-23T01:05:22.940+02:00] [DiskCache-Prune-1[Disk Cache Pruner (gerrit_file_diff-v2)]] INFO  com.google.gerrit.server.cache.h2.H2CacheImpl : Cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2 size (3.54g) is greater than maxSize (128.00m), pruning

The answer to your question is in the above line: "Cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2 size (3.54g)

3.54GBytes looks quite big and the configured maxSize is 128MBytes, therefore I’m surprised that Gerrit is actually still alive whilst trying to perform the pruning, which also failed.
Either you are OK to live with the it, and then accept that Gerrit is unresponsive during the pruning, or increase the max size of the cache on the gerrit.config.

See the caches configuration settings at [1].

A better solution would be using a more resilient and scalable persistent cache, like cache-chronicle map [2].

[2025-11-23T01:05:25.185+02:00] [DiskCache-Prune-1[Disk Cache Pruner (gerrit_file_diff-v2)]] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot prune cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2
org.h2.jdbc.JdbcSQLTimeoutException: Timeout trying to lock table {0}; SQL statement:
DELETE FROM data WHERE k=? and version=? [50200-232]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:572)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)



Also 
[2025-11-23T09:28:53.833+02:00] [HTTP GET /a/changes/?q=%28+commit%3A345e5ea204f7d9bb314157935450f742d3421a85+OR+commit%3A4afed833b1a4f167d2258b8dc5142be (SELF_REVIEW from 192.168.121.52)] WARN com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot read cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2 for FileDiffCacheKey{project=os_sed, oldCommit=commit 5129bfa498d62d2f7e35e3f4d24d93587456f2c3 0 -------, newCommit=AnyObjectId[4521173b650c2cac27f9bcf4d389e6f1227a31cb], newFilePath=module.conf, renameScore=60, diffAlgorithm=HISTOGRAM_WITH_FALLBACK_MYERS, whitespace=IGNORE_NONE, useTimeout=true} [CONTEXT TRACE_ID="1763882823320-d57d341b" request="REST /changes/" ]
org.h2.jdbc.JdbcSQLTimeoutException: Timeout trying to lock table "DATA"; SQL statement:
UPDATE data SET accessed=? WHERE k=? AND version=? [50200-232]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:572)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)

The two problems are related: the file is too big and the statements are timing out.


what should we redefine in the gerrit.config file ? 

See below.

HTH





BR

Guy


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/285c6849-c720-4926-82fc-c9fa864c4543n%40googlegroups.com.

Luca Milanesio

unread,
Nov 23, 2025, 5:09:26 AM (5 days ago) Nov 23
to Repo and Gerrit Discussion, Luca Milanesio

On 23 Nov 2025, at 09:54, Luca Milanesio <luca.mi...@gmail.com> wrote:

Hi Guy,

On 23 Nov 2025, at 08:59, Guy Levkowitz <sil...@gmail.com> wrote:

Hey

We got below error:
[2025-11-23T01:05:22.940+02:00] [DiskCache-Prune-1[Disk Cache Pruner (gerrit_file_diff-v2)]] INFO  com.google.gerrit.server.cache.h2.H2CacheImpl : Cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2 size (3.54g) is greater than maxSize (128.00m), pruning

The answer to your question is in the above line: "Cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2 size (3.54g)

3.54GBytes looks quite big and the configured maxSize is 128MBytes, therefore I’m surprised that Gerrit is actually still alive whilst trying to perform the pruning, which also failed.
Either you are OK to live with the it, and then accept that Gerrit is unresponsive during the pruning, or increase the max size of the cache on the gerrit.config.

See the caches configuration settings at [1].

A better solution would be using a more resilient and scalable persistent cache, like cache-chronicle map [2].

One last note: in our recent benchmarks of Gerrit with GHS [3], we have realised that the performance of Gerrit with the H2 (either v1 or v2) is so bad, that is actually *faster* without it !!!
So, if I were you, I’d consider seriously to go with option [2].

We moved to [3] on GerritHub.io many years ago and never experienced issues with the large persistent H2 cache again after that.


[2025-11-23T01:05:25.185+02:00] [DiskCache-Prune-1[Disk Cache Pruner (gerrit_file_diff-v2)]] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot prune cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2
org.h2.jdbc.JdbcSQLTimeoutException: Timeout trying to lock table {0}; SQL statement:
DELETE FROM data WHERE k=? and version=? [50200-232]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:572)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)



Also 
[2025-11-23T09:28:53.833+02:00] [HTTP GET /a/changes/?q=%28+commit%3A345e5ea204f7d9bb314157935450f742d3421a85+OR+commit%3A4afed833b1a4f167d2258b8dc5142be (SELF_REVIEW from 192.168.121.52)] WARN com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot read cache jdbc:h2:file:///opt/gerrit/cache/gerrit_file_diff-v2 for FileDiffCacheKey{project=os_sed, oldCommit=commit 5129bfa498d62d2f7e35e3f4d24d93587456f2c3 0 -------, newCommit=AnyObjectId[4521173b650c2cac27f9bcf4d389e6f1227a31cb], newFilePath=module.conf, renameScore=60, diffAlgorithm=HISTOGRAM_WITH_FALLBACK_MYERS, whitespace=IGNORE_NONE, useTimeout=true} [CONTEXT TRACE_ID="1763882823320-d57d341b" request="REST /changes/" ]
org.h2.jdbc.JdbcSQLTimeoutException: Timeout trying to lock table "DATA"; SQL statement:
UPDATE data SET accessed=? WHERE k=? AND version=? [50200-232]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:572)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)

The two problems are related: the file is too big and the statements are timing out.


what should we redefine in the gerrit.config file ? 

See below.

HTH


Reply all
Reply to author
Forward
0 new messages