[ https://issues.apache.org/jira/browse/SLING-8994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Timothee Maret updated SLING-8994: ---------------------------------- Fix Version/s: Content Distribution Core 0.8.0 (was: Content Distribution Core 0.7.0) > Optimize session saves for Single Queue Dispatching Strategy > ------------------------------------------------------------ > > Key: SLING-8994 > URL: https://issues.apache.org/jira/browse/SLING-8994 > Project: Sling > Issue Type: Bug > Components: Content Distribution > Reporter: Ashish Chopra > Priority: Major > Fix For: Content Distribution Core 0.8.0 > > Time Spent: 0.5h > Remaining Estimate: 0h > > Separation of concerns dictate that there's a loose coupling between > Distribution Packages and Queue entries, and thus the distribution-packages > and queue-items are persisted in different sessions (indeed, depending on > queue-impl/distribution-packaging-impl chosen there may not be a need to > persist either, or any of them at all). > To enable collection of unreferenced Distribution packages, currently, queue > items are be acquired [0] and released [1] on a per-queue basis in > {{MultipleQueueDispatchingStrategy}}. Only the distribution-packages that > don't have any live references are claimed. > For a 1:1 distribution (as {{SingleQueueDispatchingStrategy}} [2] aims to > achieve), acquring and releasing packages is superfluous (since there's only > one queue) and as such it should just be sufficient to mark the package > 'released' [3] once the queue is done with it. > However, the ref-updates still happen given way it is implemented currently > (as a subclass of {{MultipleQueueDispatchingStrategy}} that doesn't override > anything [2]). > Opening this issue propose improving {{SingleQueueDispatchingStrategy}} impl. > This should slightly optimize the book-keeping and marginally reduce the > write-overhead for 1:1 distribution. > [0] > https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/queue/impl/MultipleQueueDispatchingStrategy.java#L61 > [1] > https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessor.java#L169 > [2] > https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/queue/impl/SingleQueueDispatchingStrategy.java > [3] > https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/packaging/impl/DistributionPackageUtils.java#L107-L111 -- This message was sent by Atlassian Jira (v8.20.10#820010)