Stefan Egli created OAK-5208:
Summary: Improve observation filter switching while events are
Project: Jackrabbit Oak
Issue Type: Improvement
Affects Versions: 1.5.14
Reporter: Stefan Egli
OAK-4796 changed the model how commits are filtered for processing by the
individual observation listeners. Each BackgroundObserver has a queue of
content changes (ie commits) that are ready for being filtered, converted to
events and then delivered to listeners.
Prior to OAK-4796 the filtering of those observation events happened at the
_head_ of the queue, ie at dequeue time. Thus when switching the filter for an
observation listener it would be applied to all still queued changes as they
are being processed.
With OAK-4796 and its introduction of prefiltering, this filtering now happens
at the _tail_ of the queue, ie at enqueue time first with the _prefilter_, and
later on with the _normal_ filter at dequeue time. In essense there are now 2
filtering steps. Thus when switching the filter for an observation listener and
that listener had changes in its queue, the effect would be that still enqueued
changes would have been gone through the prefilter based on the old filter and
of the normal filter based on the new filter.
An improvement is to pass the filter applied in the prefilter along in the
queue and use the same later on for doing the normal filtering. And the filter
change would then be applied on the prefilter alone.
This message was sent by Atlassian JIRA