Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-60230

Upgrading from 6.1 to 6.2 fails when using DB sharding

    Details

      Description

      Upgrading from 6.1 to 6.2 fails when using DB sharding

      Steps to Reproduce

      1. Create 3 blank mysql databases (DB1, DB2 and DB3)
      2. Setup a clean bundle of Liferay 6120.
      3. Paste the following into the portal-ext and adjust the db properties to your machine.
        shard.selector=com.liferay.portal.dao.shard.ManualShardSelector
        
        shard.available.names=default,one,two
        
        jdbc.default.driverClassName=com.mysql.jdbc.Driver
        jdbc.default.url=jdbc:mysql://localhost/DB1?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
        jdbc.default.username=username
        jdbc.default.password=password
        
        jdbc.one.driverClassName=com.mysql.jdbc.Driver
        jdbc.one.url=jdbc:mysql://localhost/DB2?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
        jdbc.one.username=username
        jdbc.one.password=password
        
        jdbc.two.driverClassName=com.mysql.jdbc.Driver
        jdbc.two.url=jdbc:mysql://localhost/DB3?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
        jdbc.two.username=username
        jdbc.two.password=liferay
        
        spring.configs=\
            META-INF/base-spring.xml,\
            \
            META-INF/hibernate-spring.xml,\
            META-INF/infrastructure-spring.xml,\
            META-INF/management-spring.xml,\
            \
            META-INF/util-spring.xml,\
            \
            META-INF/jpa-spring.xml,\
            \
            META-INF/executor-spring.xml,\
            \
            META-INF/audit-spring.xml,\
            META-INF/cluster-spring.xml,\
            META-INF/editor-spring.xml,\
            META-INF/jcr-spring.xml,\
            META-INF/ldap-spring.xml,\
            META-INF/messaging-core-spring.xml,\
            META-INF/messaging-misc-spring.xml,\
            META-INF/mobile-device-spring.xml,\
            META-INF/notifications-spring.xml,\
            META-INF/poller-spring.xml,\
            META-INF/rules-spring.xml,\
            META-INF/scheduler-spring.xml,\
            META-INF/scripting-spring.xml,\
            META-INF/search-spring.xml,\
            META-INF/workflow-spring.xml,\
            \
            META-INF/counter-spring.xml,\
            META-INF/mail-spring.xml,\
            META-INF/portal-spring.xml,\
            META-INF/portlet-container-spring.xml,\
            META-INF/staging-spring.xml,\
            META-INF/virtual-layouts-spring.xml,\
            \
            #META-INF/dynamic-data-source-spring.xml,\
            META-INF/shard-data-source-spring.xml,\
            #META-INF/memcached-spring.xml,\
            #META-INF/monitoring-spring.xml,\
            \
            META-INF/ext-spring.xml
        
        
      4. Start the portal
      5. Go to Control Panel > Portal Instances Create a new portal instance and select the shard labled 'one'
      6. Create another (third) portal instance and select the shard labled 'two'.
      7. Stop the portal
      8. Unzip a clean bundle of 6.2 SP13
      9. Copy the above properties
      10. Place passwords.encryption.algorithm.legacy=SHA in the 6.2 portal-ext.
      11. Clear the temp and work folders and start the upgrade.

      Expected Result: The upgrade would complete correctly.
      Actual Result: The upgrade fails with this error

      com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'ga1.journalstructure' doesn't exist 

      22:39:11,257 ERROR [localhost-startStop-1][MainServlet:234] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'default_shard.journalstructure' doesn't exist
      com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'default_shard.journalstructure' doesn't exist
      	at com.liferay.portal.events.StartupAction.run(StartupAction.java:81)
      	at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1250)
      	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:231)
      	at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
      	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'default_shard.journalstructure' doesn't exist
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:170)
      	at com.liferay.portal.upgrade.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:162)
      	at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:114)
      	at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:94)
      	at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:138)
      	at com.liferay.portal.events.StartupHelper$$FastClassByCGLIB$$d389986b.invoke(<generated>)
      	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
      	at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	at com.liferay.portal.dao.shard.advice.ShardGloballyAdvice.invoke(ShardGloballyAdvice.java:57)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
      	at com.liferay.portal.events.StartupHelper$$EnhancerByCGLIB$$2e389f02.upgradeProcess(<generated>)
      	at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:61)
      	at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:143)
      	at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:182)
      	at com.liferay.portal.events.StartupAction.run(StartupAction.java:75)
      	... 19 more
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'default_shard.journalstructure' doesn't exist
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:170)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:184)
      	at com.liferay.portal.upgrade.UpgradeProcess_6_2_0.doUpgrade(UpgradeProcess_6_2_0.java:75)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:167)
      	... 37 more
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'default_shard.journalstructure' doesn't exist
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      	at com.mysql.jdbc.Util.getInstance(Util.java:386)
      	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
      	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
      	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
      	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
      	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
      	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:1418)
      	at com.liferay.portal.upgrade.v6_2_0.UpgradeJournal.updateStructures(UpgradeJournal.java:521)
      	at com.liferay.portal.upgrade.v6_2_0.UpgradeJournal.doUpgrade(UpgradeJournal.java:228)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:167)
      

      not an issue in master because we removed sharding

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                harry.chai Harry Chai
                Reporter:
                andrew.betts Andrew Betts
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 29 weeks, 3 days ago

                  Packages

                  Version Package
                  6.2.X EE