Foros de discusión

Liferay 6.2 Counter Table Sync Issue

thumbnail
William Gosse, modificado hace 6 años.

Liferay 6.2 Counter Table Sync Issue

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
Can someone please tell me how the COUNTER table in the Liferay database works in terms of how it gets updated and when it gets read by Liferay? This is a table that we ran into an issue with when we were synchronizing the Liferay databases in our two different data centers. Somehow we wound with that table being out of sync between the two centers which caused a constraint violation on a resource permission at on point.
thumbnail
Jorge Díaz, modificado hace 6 años.

RE: Liferay 6.2 Counter Table Sync Issue

Liferay Master Mensajes: 753 Fecha de incorporación: 9/01/14 Mensajes recientes
In Liferay 7 you can configure following properties in order to avoid collisions between each database:
https://docs.liferay.com/portal/7.0/propertiesdoc/portal.properties.html#Counter

It was implemented in: LPS-51313

You can try backporting the code from 7.0 to 6.2, see code changes:
thumbnail
William Gosse, modificado hace 6 años.

RE: Liferay 6.2 Counter Table Sync Issue

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
Thanks for pointing this out. Our plan is to move the DXP at some point so this will definitely help.
thumbnail
William Gosse, modificado hace 6 años.

RE: Liferay 6.2 Counter Table Sync Issue

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
I'm still concerned about how this actually works in a cluster when two liferay or more instances share a common database. Again when a threshold is met and the counter is updated, how is that new incremented value shared across the cluster if its only read a startup?
thumbnail
Jorge Díaz, modificado hace 6 años.

RE: Liferay 6.2 Counter Table Sync Issue

Liferay Master Mensajes: 753 Fecha de incorporación: 9/01/14 Mensajes recientes
Each Liferay server increments and update counter before using the id in a new object.
That is done in a different transaction, so a rollback of a new object insertion, don't rollback counter increase.

In order to increase performance, by default, Liferay servers increase counter by blocks of 100 is a each time and uses the reserved ids until all of them are used an a new block of 100 is reserved.

That increment can be configured using property counter.increment=100, more info, see the link of my previous comment.