[
https://issues.apache.org/jira/browse/SLING-13395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Schneider resolved SLING-13395.
-----------------------------------------
Resolution: Fixed
> Keep journal subscribers running when topology changes without a leadership
> change
> ----------------------------------------------------------------------------------
>
> Key: SLING-13395
> URL: https://issues.apache.org/jira/browse/SLING-13395
> Project: Sling
> Issue Type: Bug
> Components: Content Distribution
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Priority: Major
> Fix For: Content Distribution Journal Core 0.6.0
>
>
> On a clustered instance, OnlyOnLeader unregisters its service on every
> TOPOLOGY_CHANGING event and registers it again on TOPOLOGY_CHANGED.
> DistributionSubscriber has a static reference to OnlyOnLeader, so journal
> subscribers are deactivated and activated again even when the local instance
> remains leader.
> An in-flight package import can continue after deactivation. A replacement
> subscriber starts at the last committed offset + 1 and can import the same
> package concurrently, causing duplicate processing and conflicting BookKeeper
> updates.
> Keep OnlyOnLeader registered during TOPOLOGY_CHANGING. On
> TOPOLOGY_INIT/TOPOLOGY_CHANGED, register if the local instance is leader and
> unregister otherwise. Add regression coverage verifying that an unchanged
> leader retains the same service registration.
> This change avoids restarts caused by topology changes with unchanged
> leadership. It does not prevent duplicate imports during actual subscriber
> deactivation or leadership handover.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)