OneDev does not start if PostgreSQL JDBC connection string has two hosts (failover) but the first one is down (OD-1563)
jbauer opened 2 years ago

I am using PostgreSQL and their JDBC driver allows to specify multiple servers so the JDBC driver can automatically failover to the primary server in a primary + multiple secondaries DB cluster.

JDBC string with two servers (could be even more):

jdbc:postgresql://services-pg14-1:5432,services-pg14-2:5432/onedev?ApplicationName=OneDev&tcpKeepAlive=true&targetServerType=master&sslmode=require

OneDev now uses the DB host to detect the cluster IP, see https://code.onedev.io/onedev/server/~files/c0546d4c877acc58b5a857411cac605c90112fa9/server-core/src/main/java/io/onedev/server/ServerConfig.java?position=source-107.1-113.6-1

OneDev should continue to try additional hosts:port if the first one fails and multiple DB hosts have been configured.

Currently, OneDev fails to start if the first DB host is down for maintenance.

  • Robin Shen commented 2 years ago

    Will be solved in next patch release. Thx!

  • OneDev changed state to 'Closed' 2 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 2 years ago

    State changed as code fixing the issue is committed (c76fe983)

  • OneDev changed state to 'Released' 2 years ago
    Previous Value Current Value
    Closed
    Released
  • OneDev commented 2 years ago

    State changed as build #4097 is successful

issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
9.1.5
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-1563
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover