gerrit01 192.168.2.101 HAProxy traffic is defined as writes, or simply write nodes; gerrit02 192.168.2.102 HAProxy traffic is defined as read, or simply read nodes. HAProxy has temporarily commented out gerrit01.
Configure ZooKeeper in cluster mode, connectString = 192.168.2.101:2181;192.168.2.102:2181;192.168.2.103:2181;
gerrit01 clone repository,git bash,add file, commit,git push origin HEAD:refs/for/branchname
gerrit01 error_log:
[2025-12-23T15:47:07.871+08:00] [ReceiveCommits-1[receive-commits]-for-SSH git-receive-pack /code/test (admin)] ERROR com.google.gerrit.server.events.StreamEventsApiListener : Failed to dispatch event [CONTEXT PLUGIN="gerrit" RECEIVE_ID="code/test-1766476027185-26124522" TRACE_ID="1766476027184-26124522" project="code/test" request="GIT_RECEIVE" ]
com.google.gerrit.exceptions.StorageException: com.google.gerrit.server.project.NoSuchChangeException: 61
Caused by: com.google.gerrit.server.project.NoSuchChangeException: 61
at com.google.gerrit.server.notedb.ChangeNotes.onLoad(ChangeNotes.java:657)
at com.google.gerrit.server.notedb.AbstractChangeNotes.load(AbstractChangeNotes.java:170)
at com.google.gerrit.server.notedb.AbstractChangeNotes.load(AbstractChangeNotes.java:149)
at com.google.gerrit.server.notedb.ChangeNotes$Factory.createChecked(ChangeNotes.java:155)
at com.google.gerrit.server.notedb.ChangeNotes$Factory.createChecked(ChangeNotes.java:159)
at com.google.gerrit.server.events.StreamEventsApiListener.getNotes(StreamEventsApiListener.java:182)
... 31 more
gerrit01 ssh_log:
[2025-12-23T15:47:07.893+08:00] 5448fb61 [SSH git-receive-pack /code/test (admin)] admin a/1000000 git-receive-pack./code/test 46ms 1091ms - 0 git/2.31.1.windows.1 148ms 120ms 5564384 1766476027184-26124522
[2025-12-23T15:47:07.902+08:00] 5448fb61 [sshd-SshDaemon[5deae5ef](port=22)-nio2-thread-2] admin a/1000000 LOGOUT -
gerrit01 http_log: There are no logs for this commit.
gerrit02 error_log:
[2025-12-23T15:47:07.809+08:00] [Forwarded-Index-Event-1[java.util.concurrent.FutureTask@2239ef46[Not completed, task = com.google.gerrit.server.logging.LoggingContextAwareCallable@6c8f4c23]]] WARN org.eclipse.jgit.lib.CoreConfig : Both core.trustFolderStat and core.trustStat are set, ignoring trustFolderStat since trustStat takes precedence. Remove core.trustFolderStat from your configuration.
[2025-12-23T15:47:07.829+08:00] [Forwarded-Index-Event-1[java.util.concurrent.FutureTask@2239ef46[Not completed, task = com.google.gerrit.server.logging.LoggingContextAwareCallable@6c8f4c23]]] INFO com.google.gerrit.server.index.change.ChangeIndexer : Reindexing stale document StalenessCheckResult{isStale=true, reason=Optional[Document 61 missing from index]} [CONTEXT TRACE_ID="1766476027802-735d601e" ]
gerrit02 http_log:
"POST /gerrit/plugins/high-availability/event/ref-updated HTTP/1.1" 204 - 19 - "Apache-HttpClient/4.5.14 (Java/21.0.7)" 18 20 753248 - 1766476027441-ea7be896
"POST /gerrit/plugins/high-availability/index/change/code%2Ftest~61 HTTP/1.1" 204 - 3 - "Apache-HttpClient/4.5.14 (Java/21.0.7)" 1 - 118168 - 1766476027802-735d601e
"POST /gerrit/plugins/high-availability/event/ref-updated HTTP/1.1" 204 - 1 - "Apache-HttpClient/4.5.14 (Java/21.0.7)" 1 - 115832 - 1766476027816-ea7be896
"POST /gerrit/plugins/high-availability/event/ref-updated HTTP/1.1" 204 - 1 - "Apache-HttpClient/4.5.14 (Java/21.0.7)" - - 103400 - 1766476027823-735d601e
----- This is what I meant by "missing 'POST /gerrit/plugins/high-availability/event/patchset-created HTTP/1.1' 204".
gerrit02 sshd_log: There are no logs for this commit.
but browse -> repositories -> “name” -> commands -> create change
gerrit01 error_log: no error
gerrit01 http_log :
admin [2025-12-23T16:04:59.775+08:00] "POST /gerrit/changes/ HTTP/1.1" 201 488 248 - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
143.0.0.0 Safari/537.36" 92 90 5120736 - 1766477099551-ad7e300e
gerrit01 ssh_log: no log
gerrit02 http_log:
[HTTP-403] - - [2025-12-23T16:04:57.095+08:00] "GET /gerrit/config/server/version HTTP/1.0" 200 14 1 - - - - 118664 - 1766477097095-2ab0100f
[HTTP-289] - - [2025-12-23T16:04:59.721+08:00] "POST /gerrit/plugins/high-availability/index/change/code%2Ftest~62 HTTP/1.1" 204 - 2 - "Apache-HttpClient/4.5.14 (Java/21.0.7)" 1 - 108640 - 1766477099720-ea7be896
[HTTP-403] - - [2025-12-23T16:04:59.726+08:00] "POST /gerrit/plugins/high-availability/event/ref-updated HTTP/1.1" 204 - 1 - "Apache-HttpClient/4.5.14 (Java/21.0.7)" 1 10 128560 - 1766477099725-2ab0100f
[HTTP-289] - - [2025-12-23T16:04:59.737+08:00] "POST /gerrit/plugins/high-availability/event/ref-updated HTTP/1.1" 204 - 1 - "Apache-HttpClient/4.5.14 (Java/21.0.7)" 1 - 103504 - 1766477099736-ea7be896
[HTTP-403] - - [2025-12-23T16:04:59.805+08:00] "POST /gerrit/plugins/high-availability/event/patchset-created HTTP/1.1" 204 - 6 - "Apache-HttpClient/4.5.14 (Java/21.0.7)" 6 - 380568 - 1766477099799-2ab0100f
This appears to be working normally.
Everything is working normally.
ZooKeeper was configured as a single node. Considering the risk of application downtime, it was configured as a cluster. After configuration, Gerrit started without any errors.In the online environment, ZooKeeper is configured in a cluster. Switching ZooKeeper to a single-node configuration did not resolve the `git push gerrit01 error_log` issue, and Only patchset create events were not synced to gerrit02. The Gerrit triggers configured in jenkins also failed to fire. I apologize for not following the official single-node configuration. I urgently need a solution and would appreciate any assistance. Thank you.
I tried the following solutions:
Clear cache,clear zookeeper version-2 ,Reinit
reindex projects changes
None of them can solve it.
After multiple verifications, Configure ZooKeeper as a cluster,it was found to be reproducible.