在Windows 7 Enterprise / SQL Server 2012 / Java 7更新51 64位JDK上将SonarQube 4.2升级到4.3.2
设置屏幕说明:
SonarQube数据库正在升级。
大约22小时前开始(2014年7月14日11:45)
sonar.log文件如下:
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2014.07.14 11:42:31 INFO [o.s.a.Connectors] HTTP connector is enabled on port 9000
2014.07.14 11:42:32 INFO [o.a.c.h.Http11Protocol] Initializing ProtocolHandler ["http-bio-0.0.0.0-9000"]
2014.07.14 11:42:32 INFO [o.a.c.c.StandardService] Starting service Tomcat
2014.07.14 11:42:32 INFO [o.a.c.c.StandardEngine] Starting Servlet Engine: Apache Tomcat/7.0.42
2014.07.14 11:42:32 INFO [o.a.c.s.ContextConfig] No global web.xml found
2014.07.14 11:42:33 INFO [o.s.s.p.ServerImpl] SonarQube Server / 4.3.2 / a82ddddad45acebdce81bdf70767a4ee11147392
2014.07.14 11:42:33 INFO [o.s.c.p.Database] Create JDBC datasource for jdbc:jtds:sqlserver://localhost/sonardb;SelectMethod=Cursor
2014.07.14 11:42:34 INFO [o.s.s.p.DatabaseServerCompatibility] Database must be upgraded. Please browse /setup
2014.07.14 11:42:34 INFO [o.s.s.p.DefaultServerFileSystem] SonarQube home: C:\sonarqube-4.3.2
2014.07.14 11:42:34 INFO [o.s.s.p.DefaultServerFileSystem] Deploy dir: C:\sonarqube-4.3.2\web\deploy
2014.07.14 11:42:34 INFO [org.sonar.INFO] Install plugins...
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Findbugs / 2.3 / a231b7d2488255a3494a8704d8ebd3e92af7d0bf
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Timeline / 1.4 / 5dbb36d5db80475315f3f39ac3ec506ef92a9d6a
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Build Stability / 1.2 / 2b32f73fbe180e8b5b6f56271018e3b0cd2c477d
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Clirr / 1.1
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin English Pack / 4.3.2 / a82ddddad45acebdce81bdf70767a4ee11147392
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin SCM Activity / 1.7.1 / 233895448799dc2ab0274aa518a77cc1b93fed7f
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Duplications / 4.3.2 / a82ddddad45acebdce81bdf70767a4ee11147392
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Doxygen / 0.1 / 6014
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin PMD / 2.2 / a5da0c1cde1bd7be862a09dbb743fd9367c849d6
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Squid for Java / 2.3 / a231b7d2488255a3494a8704d8ebd3e92af7d0bf
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Email notifications / 4.3.2 / a82ddddad45acebdce81bdf70767a4ee11147392
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Motion Chart / 1.7 / e9c4a5c95c75564b3c3b5a887b63ef50fc59a156
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin JavaScript / 1.6 / 854b85c280793d4f983742a37b33b0449e2a65d4
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Security Rules / 0.3.2
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin XML / 1.2 / 8a0e3c61b4bf3568125302a7ac87d677e8566c1f
2014.07.14 11:42:34 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin JaCoCo / 2.3 / a231b7d2488255a3494a8704d8ebd3e92af7d0bf
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Widget Lab / 1.4.1 / f4e93e520bbecc47db57d42010c8fd267bb6e675
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Scm Stats / 0.3.1 / fd4f129d8cc73da085723c50b94936d74b1dc975
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Maven Batch Plugin / 4.3.2 / a82ddddad45acebdce81bdf70767a4ee11147392
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Surefire / 2.3 / a231b7d2488255a3494a8704d8ebd3e92af7d0bf
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Tab Metrics / 1.4 / fa240469a783a0fe5b76c752ed014add30a346df
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Checkstyle / 2.1 / 219b216223e3e2477d1588064f25fca77be922a9
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Java / 2.3 / a231b7d2488255a3494a8704d8ebd3e92af7d0bf
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Core / 4.3.2 / a82ddddad45acebdce81bdf70767a4ee11147392
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Database Cleaner / 4.3.2 / a82ddddad45acebdce81bdf70767a4ee11147392
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Cobertura / 1.6.2 / 97fa42dd2ec9396debeeee6622eaa1df59e71f12
2014.07.14 11:42:35 INFO [o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Design / 4.3.2 / a82ddddad45acebdce81bdf70767a4ee11147392
2014.07.14 11:42:35 INFO [org.sonar.INFO] Install plugins done: 405 ms
2014.07.14 11:42:35 INFO [o.s.s.p.RailsAppsDeployer] Deploy Ruby on Rails applications
2014.07.14 11:42:35 INFO [o.s.s.p.RailsAppsDeployer] Deploy app: motionchart
2014.07.14 11:42:35 INFO [jruby.rack] jruby 1.7.9 (ruby-1.8.7p370) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.7.0_51-b13 [Windows 7-amd64]
2014.07.14 11:42:35 INFO [jruby.rack] using a shared (threadsafe!) runtime
2014.07.14 11:42:46 INFO [jruby.rack] keeping custom (config.logger) Rails logger instance
Database must be upgraded. Please browse /setup
2014.07.14 11:42:46 INFO [o.a.c.h.Http11Protocol] Starting ProtocolHandler ["http-bio-0.0.0.0-9000"]
2014.07.14 11:42:46 INFO Web server is started
2014.07.14 11:45:23 INFO [DbMigration] == CreateQualityGates: migrating =============================================
2014.07.14 11:45:23 INFO [DbMigration] -- create_table(:quality_gates, {})
2014.07.14 11:45:23 INFO [DbMigration] -> 0.0090s
2014.07.14 11:45:23 INFO [DbMigration] -> 0 rows
2014.07.14 11:45:23 INFO [DbMigration] -- add_index("quality_gates", ["name"], {:unique=>true, :name=>"uniq_quality_gates"})
2014.07.14 11:45:23 INFO [DbMigration] -> 0.0450s
2014.07.14 11:45:23 INFO [DbMigration] -> 0 rows
2014.07.14 11:45:23 INFO [DbMigration] == CreateQualityGates: migrated (0.0560s) ====================================
2014.07.14 11:45:23 INFO [DbMigration]
2014.07.14 11:45:23 INFO [DbMigration] == CreateQualityGateConditions: migrating ====================================
2014.07.14 11:45:23 INFO [DbMigration] -- create_table(:quality_gate_conditions, {})
2014.07.14 11:45:23 INFO [DbMigration] -> 0.0050s
2014.07.14 11:45:23 INFO [DbMigration] -> 0 rows
2014.07.14 11:45:23 INFO [DbMigration] == CreateQualityGateConditions: migrated (0.0050s) ===========================
2014.07.14 11:45:23 INFO [DbMigration]
2014.07.14 11:45:23 INFO [DbMigration] == ConvertAlertsToQualityGates: migrating ====================================
2014.07.14 11:45:23 INFO [DbMigration] == ConvertAlertsToQualityGates: migrated (0.0730s) ===========================
2014.07.14 11:45:23 INFO [DbMigration]
2014.07.14 11:45:23 INFO [DbMigration] == UpdateIssueDebtToMinutes: migrating =======================================
2014.07.14 11:45:34 INFO [o.s.s.d.m.MassUpdater] 447217 rows have been updated
2014.07.14 11:45:34 INFO [DbMigration] == UpdateIssueDebtToMinutes: migrated (10.5750s) =============================
2014.07.14 11:45:34 INFO [DbMigration]
2014.07.14 11:45:34 INFO [DbMigration] == UpdateIssueChangelogDebtToMinutes: migrating ==============================
2014.07.14 11:45:35 INFO [o.s.s.d.m.MassUpdater] 39 rows have been updated
2014.07.14 11:45:35 INFO [DbMigration] == UpdateIssueChangelogDebtToMinutes: migrated (1.0090s) =====================
2014.07.14 11:45:35 INFO [DbMigration]
2014.07.14 11:45:35 INFO [DbMigration] == UpdateMeasuresDebtToMinutes: migrating ====================================
运行SQL Server跟踪显示的唯一数据库活动是每隔几秒“SELECT 1”
审核了SQL活动监视器并注意到阻止的以下SQL语句:
SQL进程:56被56
阻止SELECT pm.id, pm.value , pm.variation_value_1 , pm.variation_value_2, pm.variation_value_3 , pm.variation_value_4 , pm.variation_value_5 FROM project_measures pm INNER JOIN metrics m on m.id=pm.metric_id WHERE (m.name='sqale_index' or m.name='new_technical_debt' or m.name='sqale_effort_to_grade_a' or m.name='sqale_effort_to_grade_b' or m.name='sqale_effort_to_grade_c' or m.name='sqale_effort_to_grade_d' or m.name='blocker_remediation_cost' or m.name='critical_remediation_cost' or m.name='major_remediation_cost' or m.name='minor_remediation_cost' or m.name='info_remediation_cost' )
SQL进程:58被56阻止
(@P0 float,@P1 float,@P2 float,@P3 float,@P4 float,@P5 float,@P6 bigint)UPDATE project_measures SET value= @P0 ,variation_value_1= @P1 ,variation_value_2= @P2 ,variation_value_3= @P3 ,variation_value_4= @P4 ,variation_value_5= @P5 WHERE id= @P6
等待22个多小时之后,杀死了SQL进程58,并在sonar.log中注意到以下堆栈:
2014.07.15 10:13:50 INFO [o.s.s.d.m.MassUpdater] 8000 rows have been updated
2014.07.15 10:13:50 ERROR [o.s.s.d.m.DatabaseMigrator] Fail to execute database migration: org.sonar.server.db.migrations.v43.TechnicalDebtMeasuresMigration
org.sonar.api.utils.MessageException: Fail to migrate data, error is : The server returned an unspecified error.
任何人都可以告诉我升级实际上是挂起还是只是很慢,是否还有其他人遇到过这种情况,如果是这样,它是如何解决的。
在从4.2升级到4.3时,我已经审查过类似的帖子,但我升级到4.3.2,我认为这个问题已经解决了。
答案 0 :(得分:0)
我已经通过应用以下数据库索引解决了这个问题:
CREATE NONCLUSTERED INDEX [exelidx_metric_id]
ON [dbo].[project_measures] ([metric_id])
INCLUDE ([id],[value],[variation_value_1],[variation_value_2],[variation_value_3],[variation_value_4],[variation_value_5])
GO
CREATE NONCLUSTERED INDEX [exelidx_characteristic_id]
ON [dbo].[project_measures] ([characteristic_id])
INCLUDE ([id])
GO
升级在8分钟内成功完成。