AEM Mongo Cluster

Avatar

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile
DhirajAg
Level 3

22-10-2018

I have three AEM author instances in a cluster - Mongo 3 instances replica set.

If i make a change to a template in crxde in one of the instances, i can see the change getting reflected in all 3 AEM instances in crxde, but when I am hitting a page of that template changes are not reflecting in the other two instances. Is there a cache configuration I am missing?

Have tried this on AEM 6.3.2 and 6.3.3

Restarting Apache Sling Resource Resolver on the other instance resolves the issue and I can see the new changes on the page.

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

22-10-2018

There are situations where i can seen when a restart resolves issues. This may fall into one of those situations.

Avatar

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile
DhirajAg
Level 3

22-10-2018

Yes restarting the server also resolves the issue, but why is it happening in the first place. Also restarting the server in a prod environment is not possible.

Avatar

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile
DhirajAg
Level 3

22-10-2018

So I found the HTMLs to be cached at /system/console/scriptcache . Once I cleared this cache it worked fine. I then changed the config at Apache Sling Script Cache to set the cache size to 0 so that nothing is cached. However i think this is an odd behavior of AEM in a mongo cluster where the cache is not invalidated automatically from the other AEM servers.

Any pointers on this ?

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

23-10-2018

What template have you changed? is it an editable template and you expected that all pages it using have been adapted (what should happen)?

Jörg

Avatar

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile
DhirajAg
Level 3

23-10-2018

It is not an editable template but a static template and if i make a change on one server, the HTML of that component is invalidated on only that server and not the others. I believe since the change is reflected in all servers of the cluster the cache should also get invalidated in all, else there would always be an issue of some servers showing different content.

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

23-10-2018

what do you mean with "the html of that component is invalidated ..."? Do you modify a template T (more specifically a page component T) and then you open a page based on this template/page component T ? And only on the server on which you perform the change the page display is changed, but not on the 2 others?

Avatar

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile
DhirajAg
Level 3

23-10-2018

Thats correct Jorg. In my scenario i am modifying a page component but it can be any script that is compiled.

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

23-10-2018

indeed, that's strange. Changes to components should be picked up by observation and then the script cache should get invalidated, there shouldn't be any explicit invalidation. Can you set the loglevel for the class "org.apache.sling.scripting.core.impl.ScriptCacheImpl" to DEBUG  and re-do your tests again? Make sure that this logging is set on all cluster instances.

Jörg

Avatar

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile

Avatar
Validate 1
Level 3
DhirajAg
Level 3

Likes

12 likes

Total Posts

65 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile
DhirajAg
Level 3

23-10-2018

This is what i found in the debug log and this was observed on the server where the change was done and not seen in other servers.

23.10.2018 17:10:50.296 *DEBUG* [sling-script-cache-thread-pool-1] org.apache.sling.scripting.core.impl.ScriptCacheImpl Detected script change for /apps/sample/components/templates/cnt-errorpage/footer.html - removed entry from the cache.

23.10.2018 17:11:00.368 *DEBUG* [sling-script-cache-thread-pool-2] org.apache.sling.scripting.core.impl.ScriptCacheImpl Detected script change for /apps/sample/components/templates/cnt-errorpage/footer.html - removed entry from the cache.