We have moved to GitHub Issues
Created by Patrick Scott 30 Oct 2015, 20:22:13 Updated by Patrick Scott 11 Jan 2016, 09:37:14
This is with 7.3.0
I have a site with around 50 hostnames defined on a root node. Three times in the last week, the in memory cache of hostnames gets corrupted and only around 10 are linked to that node (the rest are missing). A restart of the app pool re-loads the hostnames from the db and it works fine again. There is nothing unusual in the logs.
I have looked into the core code and I think this is to do with the way the caching of the umbracoDomain table is done. In pre 7.3 there was one cache item "UmbracoDomainList" and in 7.3 there is one cache item per domain e.g. "umbrtmche-uRepo_IDomain_RowID" - it is caching at the repository level now.
I am assuming if a cache item is expired/removed then this is not reloaded from the database then umbraco routing assumes it does not exist. The next time I have this issue I will check to see what items are in the cache and update here.
Might be related to this (short version is it only caches up to about 100 domains): https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/72571-fetching-url-on-ipublishedcontent-hits-database
OK, I can confirm that when I have this issue, the related domain names are not in the cache. I have compared the domains shown in the "culture and hostnames" dialog box to the "umbrtmche-uRepo_IDomain_RowID" cache items and the hostnames missing from the dialog box are the ones which have been removed from the cache.
@Knickerbocker This may well be related as I think both have appeared due to the change in the way domains are cached.
Reading through the code, if I understand the repository caching, this is due to the RepositoryCacheOptions.GetAllCacheValidateCount being set to false. This means that if any of the IDomain cache items are expired from the cache then the domains are not reloaded from the database and just the domains left in the cache are returned in the GetAll() function call.
Confirmed - the repository cache needs some love.
@zpqrtbnk Is the caching of domains going to be looked at separately? I thought this would be a critical error as sites can go offline unexpectedly as the code stands now.
Well, this is about the caching of domains too. Only, here it is a cache corruption/refresh issue (IIC) and the other issue is that we stop caching if you have more than 100 domains. You can create a separate issue if you want but I think we need is a global review of that cache code and that would deal with both issues. Making sense?
Yes, that makes sense, I was just hoping for a quick fix - in 7.3.2?
@Kim.Thomsen This issue is being addressed in U4-7558 which should be released in 7.3.5 soon.
Backwards Compatible: True
Affected versions: 7.3.0, 7.3.1
Due in version: