Choerodon 0.19升级0.20 devops升级失败

  • Choerodon平台版本: 0.20.0

  • 遇到问题的执行步骤:
    helm upgrade devops-service c7n/devops-service --set env.open.AGENT_VERSION=“0.20.1” -f <(helm get values devops-service) --version 0.20.3

  • 报错日志:
    Error: timed out waiting for the condition
    Error: UPGRADE FAILED: timed out waiting for the condition

pods log:
sage: Could not acquire change log lock. Currently locked by devops-service-init-db-gsdv4 (10.244.0.177) since 1/9/20 6:12 PM, exception:

liquibase.exception.LockException: Could not acquire change log lock. Currently locked by devops-service-init-db-gsdv4 (10.244.0.177) since 1/9/20 6:12 PM
at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:190) ~[liquibase-core-3.5.5.jar!/:na]
at liquibase.Liquibase.clearCheckSums(Liquibase.java:1335) ~[liquibase-core-3.5.5.jar!/:na]
at io.choerodon.liquibase.LiquibaseExecutor.load(LiquibaseExecutor.java:270) ~[choerodon-liquibase-0.11.0.RELEASE.jar!/:0.11.0.RELEASE]
at io.choerodon.liquibase.LiquibaseExecutor.runToDb(LiquibaseExecutor.java:193) ~[choerodon-liquibase-0.11.0.RELEASE.jar!/:0.11.0.RELEASE]
at io.choerodon.liquibase.LiquibaseExecutor.execute(LiquibaseExecutor.java:97) ~[choerodon-liquibase-0.11.0.RELEASE.jar!/:0.11.0.RELEASE]
at io.choerodon.liquibase.StartupRunner.run(StartupRunner.java:28) [classes!/:0.11.0.RELEASE]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:792) [spring-boot-2.0.6.RELEASE.jar!/:2.0.6.RELEASE]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:776) [spring-boot-2.0.6.RELEASE.jar!/:2.0.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.0.6.RELEASE.jar!/:2.0.6.RELEASE]
at io.choerodon.liquibase.LiquibaseTools.main(LiquibaseTools.java:18) [classes!/:0.11.0.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)

  • 原因分析:

    升级过程中会首先执行数据库初始化操作,liquibase数据库操作失败被锁,以后再执行均会报错

  • 疑问:

    请问如何才能解锁继续执行

你好,liquibase的锁是由devops-service数据库的databasechangeloglock表的LOCKED字段的值控制的


更新这个值为0(解锁的sql)是:

UPDATE databasechangeloglock
SET LOCKED = 0
WHERE ID = (SELECT * FROM (SELECT ID FROM databasechangeloglock dblock LIMIT 1) tmp);