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

Some caches' clustering properties are no longer configurable

    Details

      Description

      Description
      We recently discovered that the WebServerServletToken cache was replicating puts when it should not have been. As a result, we created LPS-77319 and made them never replicate puts. In reality, this was not the correct fix. It is intended that these properties should be configurable via the ehcache.replicator.properties.{$CACHE_NAME} portal properties. Moreover, it is intended that the WebServerServletToken cache would have replicatePuts=false by default. However, the cache name in portal.properties was incorrect, as it was missing the word "kernel". This is the real reason behind the bug reported in LPS-77319.

      1. Prepare a two-node Liferay cluster pointing to a shared database (it's simpler to deploy master-private than master for this purpose). If you only have one computer, you can follow these steps to have a simple unicast cluster with master-private:
        1. Duplicate your LIFERAY_HOME folder (Tomcat folder, OSGi folder, etc.) to create two nodes
        2. Update server.xml on each node to use different ports (use 81xx on node1 and use 82xx on the node2)
        3. Update portal-ext.properties so both use a shared database
        4. Update portal-ext.properties to also contain the following entries related to clustering:
          cluster.link.autodetect.address=
          cluster.link.enabled=true
          cluster.link.channel.properties.control=tcp.xml
          cluster.link.channel.properties.transport.0=tcp.xml
          
        5. Add the following to setenv.sh to setup jgroups for clustering:
          CATALINA_OPTS="${CATALINA_OPTS} -Djgroups.bind_addr=127.0.0.1 -Djgroups.tcpping.initial_hosts=localhost[7801],localhost[7802],localhost[7803],localhost[7804]"
          
      2. Make sure to deploy the clustering modules to both nodes
      3. Add the following line to portal-ext.properties on both nodes: ehcache.replicator.properties.com.liferay.portal.kernel.webserver.WebServerServletToken=replicatePuts=false
      4. Add the attached com.liferay.portal.cache-log4j-ext.xml to the osgi/log4j folder on both nodes
      5. Start up one node in the cluster and let it populate your database
      6. Start up the second node
      7. Navigate to the home page on node 1 http://localhost:8180/ and note that the following is logged on node1
        02:29:55,606 DEBUG [http-nio-8080-exec-6][WebServerServletToken:126] Put 0 into com.liferay.portal.kernel.webserver.WebServerServletToken
        02:29:55,608 DEBUG [http-nio-8080-exec-6][WebServerServletToken:126] Put 20175 into com.liferay.portal.kernel.webserver.WebServerServletToken
        
      8. Navigate to the home page on node 2 http://localhost:8280/ and verify that there is no logging on node 1 indicating that an entry was removed from the WebServerServletToken cache (if such logging exists, then this should fail QA).
      9. Now we'll test the true case. Shut down both nodes and amend the line added above in each portal-ext.properties as follows: ehcache.replicator.properties.com.liferay.portal.kernwebserver.WebServerServletToken=replicatePuts=true
      10. Start up both nodes of the cluster.
      11. Navigate to the home page on node 1 and verify that the following logging is added on node 1:
        02:29:55,606 DEBUG [http-nio-8080-exec-6][WebServerServletToken:126] Put 0 into com.liferay.portal.kernel.webserver.WebServerServletToken
        02:29:55,608 DEBUG [http-nio-8080-exec-6][WebServerServletToken:126] Put 20175 into com.liferay.portal.kernel.webserver.WebServerServletToken
        
      12. Navigate to the home page on node 2 and observe the logging on node 1.

      Expected Result: There is logging on node 1 indicating that a value was removed from the WebServerServletToken cache.
      Actual Result: There is no logging on node 1 indicating that a value was removed from the WebServerServletToken cache, indicating that the portal property you added did not take effect.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 39 weeks, 1 day ago

                  Packages

                  Version Package
                  7.0.0 DXP FP42
                  7.0.6 CE GA7
                  7.0.0 DXP SP8
                  7.0.X
                  7.1.0 M2
                  7.1.X
                  Master