Error "Timeout trying to lock table" after upgrade Gerrit from 3.5.4 to 3.6.6

114 views
Skip to first unread message

shang...@gmail.com

unread,
Aug 10, 2023, 10:32:06 AM8/10/23
to Repo and Gerrit Discussion
Hello friends,

I upgraded the Gerrit from 3.5.4 to 3.6.6. According to the release note, I ran the "copy-approvals" command via ssh. After upgrade, I ran the reindex like
/usr/bin/java -jar /gerrit/bin/gerrit.war reindex -d /gerrit/siteroot/v3.6.6, and there is no error during the whole process, but after running the Gerrit for some times, I found there are some errors like the following:

Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "ACCOUNT_PATCH_REVIEWS"; SQL statement:
INSERT INTO account_patch_reviews (account_id, change_id, patch_set_id, file_name) VALUES (?, ?, ?, ?) [50200-176]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)

Could anybody help me out?

Thanks a lot

shang...@gmail.com

unread,
Aug 10, 2023, 10:33:21 AM8/10/23
to Repo and Gerrit Discussion
By the way, I ran the offline-reindex again when I found the error, but they are still there.

Fabio Ponciroli

unread,
Aug 10, 2023, 11:05:54 AM8/10/23
to shang...@gmail.com, Repo and Gerrit Discussion
Hi,


It looks like Gerrit cannot lock the H2 table used to store the "reviewed flag".

Can you check the permissions in your db directory?

> ls -lrt $GERRIT_SITE/db/
total 36
-rw-r--r-- 1 gerrit gerrit 32768 Jun  4  2019 account_patch_reviews.h2.db <<=== this should belong to the user running Gerrit, can you double check?

HTH,
Ponch
 

--
--
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 on the web visit https://groups.google.com/d/msgid/repo-discuss/ec9a5ad9-dfe2-471b-86b2-b0e32b594babn%40googlegroups.com.

shang...@gmail.com

unread,
Aug 10, 2023, 10:45:07 PM8/10/23
to Repo and Gerrit Discussion
Hey Fabio,

Thank you for your quick response, I check the db folder, the permission looks good

$ ls -l
total 32169
-rw-rw-r--. 1 gerrit2 gerrit2 222425088 Aug 10 01:12 account_patch_reviews.h2.db
-rw-rw-r--. 1 gerrit2 gerrit2  60147089 Aug 11 02:24 account_patch_reviews.trace.db
-rw-rw-r--. 1 gerrit2 gerrit2  67177376 Aug 10 20:56 account_patch_reviews.trace.db.old
-rw-rw-r--. 1 gerrit2 gerrit2     36864 Aug 11 02:24 CiDB.h2.db.h2.db
-rw-rw-r--. 1 gerrit2 gerrit2   6782008 Aug  4 02:12 CiDB.h2.db.trace.db

One question about "It looks like Gerrit cannot lock the H2 table used to store the "reviewed flag", how should I do to store the reviewd flag.

Many thanks.

Björn Pedersen

unread,
Aug 11, 2023, 6:48:37 AM8/11/23
to Repo and Gerrit Discussion
shang...@gmail.com schrieb am Freitag, 11. August 2023 um 04:45:07 UTC+2:
Hey Fabio,

Thank you for your quick response, I check the db folder, the permission looks good

$ ls -l
total 32169
-rw-rw-r--. 1 gerrit2 gerrit2 222425088 Aug 10 01:12 account_patch_reviews.h2.db
-rw-rw-r--. 1 gerrit2 gerrit2  60147089 Aug 11 02:24 account_patch_reviews.trace.db
-rw-rw-r--. 1 gerrit2 gerrit2  67177376 Aug 10 20:56 account_patch_reviews.trace.db.old
-rw-rw-r--. 1 gerrit2 gerrit2     36864 Aug 11 02:24 CiDB.h2.db.h2.db
-rw-rw-r--. 1 gerrit2 gerrit2   6782008 Aug  4 02:12 CiDB.h2.db.trace.db

One question about "It looks like Gerrit cannot lock the H2 table used to store the "reviewed flag", how should I do to store the reviewd flag.


Is this on a "slow" (e.g. nfs) filesystem? Or is (or was) the filesystem full?

shang...@gmail.com

unread,
Aug 11, 2023, 8:01:58 AM8/11/23
to Repo and Gerrit Discussion
Hey  Björn,

You are right, the disk is full. I have extend the disk and did a reindex on Gerrit, now it looks good now.

Thanks  Björn and Fabio for your help

Reply all
Reply to author
Forward
0 new messages