You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Ashish Chopra (Jira)" <ji...@apache.org> on 2020/01/14 04:07:00 UTC

[jira] [Created] (SLING-8994) Optimize session saves for Single Queue Dispatching Strategy

Ashish Chopra created SLING-8994:
------------------------------------

             Summary: 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
             Fix For: Content Distribution Core 0.4.2


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.3.4#803005)