On Wed, 16 Jul 2014 07:29:18 -0700, Damon Feldman  
<[email protected]> wrote:

>
> I can only think of wanting to clear the Expanded Tree Cache when you  
> are doing performance testing and want to compare cold to warm caches.  
> MarkLogic automatically invalidates documents in the cache when they  
> change, so there should be no impact on your running system other than  
> slowing down performance.
>
> I think there are two possibilities:
>       * the schema validation started working for some other reason, and only 
>  
> happened to coincide with clearing the ETC
>       * there is a bug in schema handling interacting with the cache. In that 
>  
> case, you would only clear it if you changed the schema, and only until  
> a bug fix is available.

There is a known issue with schema caching wrt the expanded tree
cache.  The schema cache itself gets invalidated properly, but some
of the information derived from the use of that schema is not.

If you have a document that has been assigned types under a
previous schema, and then you change the schema, that document may
still be in the expanded tree cache with the type assignments previously
calculated. Since it is expensive to calculate those assignments, they are
aggressively cached. (It is also calculated and used way more than you
think. Every time a node is atomized -- i.e. its value is passed to a  
function
or operator, or you call fn:data on it.) Invalidating that information on a
case-by-case basis has proved quite difficult and there are still a lot of
holes. Invalidating it on a global basis would be destructive to  
performance
for everyone. It means having to refetch documents off disk, and
recalculate their type assessments (if necessary) whether their schema
changed or not.

By and large the schema stickiness issue is an issue only during schema
development. So, yes, only clear it on a schema update. And really, you
should only need to do it if you have already been applying the previous
version. If you think you need to do this kind of thing as part of your
normal application flow, let's talk about what you're trying to accomplish,
because that probably isn't the best way to go about things.

//Mary

>
> Yours,
> Damon
>
>
> -----Original Message-----
> From: [email protected]  
> [mailto:[email protected]] On Behalf Of Tim
> Sent: Monday, July 14, 2014 7:27 PM
> To: 'MarkLogic Developer Discussion'
> Subject: Re: [MarkLogic Dev General] Strict validation error encountered  
> in ML7 but not in ML6
>
> BTW, when is it NOT a good idea to clear the expanded tree cache?
>
> Tim
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Tim
> Sent: Monday, July 14, 2014 6:10 PM
> To: 'MarkLogic Developer Discussion'
> Subject: Re: [MarkLogic Dev General] Strict validation error encountered  
> in ML7 but not in ML6
>
> Hi Mary,
>
> Clearing the expanded tree cache after updating the schema did the trick!
>
> Thank you,
>
> Tim
>
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to