-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.2.10 EE GA1
-
Fix Version/s: 6.1.X EE, 6.2.2 CE GA3 , 6.2.X EE, 7.0.0 M3
-
Component/s: Core Infrastructure, Core Infrastructure > Sharding
-
Branch Version/s:6.2.x, 6.1.x
-
Backported to Branch:Committed
-
Story Points:1
-
Fix Priority:4
-
Git Pull Request:
DESCRIPTION
When Audit Hook is deployed, adding a site role to a user in shard 2 results in an update to shard 1's UserGroupRole db table instead of shard 2's db.
STEPS TO REPRODUCE
1. Install Audit Hook
2. Set up Liferay for sharding - 2 instances connecting to separate databases:
set the following in portal-ext:
shard.available.names=default,one
shard.selector=com.liferay.portal.dao.shard.ManualShardSelector
jdbc.default.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.default.url=jdbc:oracle:thin:@localhost:1521:orcl
jdbc.default.username=defaultdb
jdbc.default.password=password
jdbc.one.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.one.url=jdbc:oracle:thin:@localhost:1521:orcl
jdbc.one.username=onedb
jdbc.one.password=password
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,\
META-INF/ext-announcement-spring.xml,\
META-INF/ext-ldap-spring.xml
start server
Go to control panel>Portal Instances
Add new instance
give new instance a different web id, virtual host, mail domain from the first instance. You may need to add an entry to your OS's hosts file if you haven't already.
connect new instance to "one" schema
Connect to 2nd instance and login to confirm that instance is working.
3. Assign a site role to a user in the 2nd instance
4. Check USERGROUPROLE table in first database to see if new entry was added
5. Check USERGROUPROLE table in second database to see if new entry was added
EXPECTED RESULTS
USERGROUPROLE table is updated in shard 2 database
ACTUAL RESULTS
USERGROUPROLE table is updated in shard 1 database. Shard 2 database is not updated.
BRANCH
Reproduced
commit 599a8ff7f64c83e4244d6e2a90e8b920e5bb6aa7
MASTER
Can't test in Master. Unable to create accessible 2nd instance for testing.
An unexpected system error occurred.
com.liferay.portal.NoSuchGroupException: No Group exists with the key
{companyId=10726, classNameId=10025, classPK=10726}