From 83e5974301ec047a27b56421335b010c83809d64 Mon Sep 17 00:00:00 2001 From: Albert Louis Rossi Date: Mon, 14 Aug 2023 08:35:41 -0500 Subject: [PATCH] dcache-qos: remove singleton service configuration Motivation: As originally conceived, the qos service suite could be run as a single component. The added maintenance overhead for configuration duplication and testing is not really justified; not much is gained by doing this and I imagine the option has not yet even been tried. Modification: Deprecate/eliminate the option. Result: Less to maintain and test. Target: master Patch: https://rb.dcache.org/r/14053/ Requires-notes: yes Requires-book: yes (included) Acked-by: Tigran --- .../src/main/markdown/config-qos-engine.md | 4 + .../clients/LocalQoSAdjustmentClient.java | 89 --- .../clients/LocalQoSVerificationClient.java | 114 ---- .../src/main/resources/org/dcache/qos/qos.xml | 620 ------------------ skel/share/defaults/qos.properties | 34 +- skel/share/services/qos.batch | 88 --- 6 files changed, 21 insertions(+), 928 deletions(-) delete mode 100644 modules/dcache-qos/src/main/java/org/dcache/qos/local/clients/LocalQoSAdjustmentClient.java delete mode 100644 modules/dcache-qos/src/main/java/org/dcache/qos/local/clients/LocalQoSVerificationClient.java delete mode 100644 modules/dcache-qos/src/main/resources/org/dcache/qos/qos.xml delete mode 100644 skel/share/services/qos.batch diff --git a/docs/TheBook/src/main/markdown/config-qos-engine.md b/docs/TheBook/src/main/markdown/config-qos-engine.md index a231930da3c..f910275cfb5 100644 --- a/docs/TheBook/src/main/markdown/config-qos-engine.md +++ b/docs/TheBook/src/main/markdown/config-qos-engine.md @@ -146,6 +146,10 @@ With respect to the example scanner domain: the scanner communicates directly wi so `chimera.db.host` should be set explicitly if it is not running on the same host as the database. +> NOTE: As of dCache 9.2, the singleton configuration has been removed. Each of the +> separate services can be run together in one domain or in separate domains, but it is +> no longer possible to run the entire QoS component suite as a single service. + ### Memory requirements While it is possible to run QoS in the same domain as other services, diff --git a/modules/dcache-qos/src/main/java/org/dcache/qos/local/clients/LocalQoSAdjustmentClient.java b/modules/dcache-qos/src/main/java/org/dcache/qos/local/clients/LocalQoSAdjustmentClient.java deleted file mode 100644 index 10dbf979e13..00000000000 --- a/modules/dcache-qos/src/main/java/org/dcache/qos/local/clients/LocalQoSAdjustmentClient.java +++ /dev/null @@ -1,89 +0,0 @@ -/* -COPYRIGHT STATUS: -Dec 1st 2001, Fermi National Accelerator Laboratory (FNAL) documents and -software are sponsored by the U.S. Department of Energy under Contract No. -DE-AC02-76CH03000. Therefore, the U.S. Government retains a world-wide -non-exclusive, royalty-free license to publish or reproduce these documents -and software for U.S. Government purposes. All documents and software -available from this server are protected under the U.S. and Foreign -Copyright Laws, and FNAL reserves all rights. - -Distribution of the software available from this server is free of -charge subject to the user following the terms of the Fermitools -Software Legal Information. - -Redistribution and/or modification of the software shall be accompanied -by the Fermitools Software Legal Information (including the copyright -notice). - -The user is asked to feed back problems, benefits, and/or suggestions -about the software to the Fermilab Software Providers. - -Neither the name of Fermilab, the URA, nor the names of the contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. - -DISCLAIMER OF LIABILITY (BSD): - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FERMILAB, -OR THE URA, OR THE U.S. DEPARTMENT of ENERGY, OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Liabilities of the Government: - -This software is provided by URA, independent from its Prime Contract -with the U.S. Department of Energy. URA is acting independently from -the Government and in its own private capacity and is not acting on -behalf of the U.S. Government, nor as its contractor nor its agent. -Correspondingly, it is understood and agreed that the U.S. Government -has no connection to this software and in no manner whatsoever shall -be liable for nor assume any responsibility or obligation for any claim, -cost, or damages arising out of or resulting from the use of the software -available from this server. - -Export Control: - -All documents and software available from this server are subject to U.S. -export control laws. Anyone downloading information from this server is -obligated to secure any necessary Government licenses before exporting -documents or software obtained from this server. - */ -package org.dcache.qos.local.clients; - -import diskCacheV111.util.PnfsId; -import org.dcache.qos.QoSException; -import org.dcache.qos.listeners.QoSAdjustmentListener; -import org.dcache.qos.services.adjuster.handlers.QoSAdjusterTaskHandler; -import org.dcache.qos.vehicles.QoSAdjustmentRequest; - -/** - * A pass-through to the adjuster task handler. Use this listener when plugging in directly to the - * adjustment service. - */ -public final class LocalQoSAdjustmentClient implements QoSAdjustmentListener { - - private QoSAdjusterTaskHandler taskHandler; - - @Override - public void fileQoSAdjustmentRequested(QoSAdjustmentRequest adjustmentRequest) { - taskHandler.handleAdjustmentRequest(adjustmentRequest); - } - - @Override - public void fileQoSAdjustmentCancelled(PnfsId pnfsId) throws QoSException { - taskHandler.handleAdjustmentCancelled(pnfsId); - } - - public void setTaskHandler(QoSAdjusterTaskHandler taskHandler) { - this.taskHandler = taskHandler; - } -} diff --git a/modules/dcache-qos/src/main/java/org/dcache/qos/local/clients/LocalQoSVerificationClient.java b/modules/dcache-qos/src/main/java/org/dcache/qos/local/clients/LocalQoSVerificationClient.java deleted file mode 100644 index a082d006a2a..00000000000 --- a/modules/dcache-qos/src/main/java/org/dcache/qos/local/clients/LocalQoSVerificationClient.java +++ /dev/null @@ -1,114 +0,0 @@ -/* -COPYRIGHT STATUS: -Dec 1st 2001, Fermi National Accelerator Laboratory (FNAL) documents and -software are sponsored by the U.S. Department of Energy under Contract No. -DE-AC02-76CH03000. Therefore, the U.S. Government retains a world-wide -non-exclusive, royalty-free license to publish or reproduce these documents -and software for U.S. Government purposes. All documents and software -available from this server are protected under the U.S. and Foreign -Copyright Laws, and FNAL reserves all rights. - -Distribution of the software available from this server is free of -charge subject to the user following the terms of the Fermitools -Software Legal Information. - -Redistribution and/or modification of the software shall be accompanied -by the Fermitools Software Legal Information (including the copyright -notice). - -The user is asked to feed back problems, benefits, and/or suggestions -about the software to the Fermilab Software Providers. - -Neither the name of Fermilab, the URA, nor the names of the contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. - -DISCLAIMER OF LIABILITY (BSD): - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FERMILAB, -OR THE URA, OR THE U.S. DEPARTMENT of ENERGY, OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Liabilities of the Government: - -This software is provided by URA, independent from its Prime Contract -with the U.S. Department of Energy. URA is acting independently from -the Government and in its own private capacity and is not acting on -behalf of the U.S. Government, nor as its contractor nor its agent. -Correspondingly, it is understood and agreed that the U.S. Government -has no connection to this software and in no manner whatsoever shall -be liable for nor assume any responsibility or obligation for any claim, -cost, or damages arising out of or resulting from the use of the software -available from this server. - -Export Control: - -All documents and software available from this server are subject to U.S. -export control laws. Anyone downloading information from this server is -obligated to secure any necessary Government licenses before exporting -documents or software obtained from this server. - */ -package org.dcache.qos.local.clients; - -import diskCacheV111.util.PnfsId; -import javax.security.auth.Subject; -import org.dcache.qos.QoSException; -import org.dcache.qos.listeners.QoSVerificationListener; -import org.dcache.qos.services.verifier.handlers.VerifyOperationHandler; -import org.dcache.qos.vehicles.QoSAdjustmentResponse; -import org.dcache.qos.vehicles.QoSScannerVerificationRequest; -import org.dcache.qos.vehicles.QoSVerificationRequest; - -/** - * A pass-through to the file operation handler. Use this listener when plugging in directly to the - * verification service. - */ -public final class LocalQoSVerificationClient implements QoSVerificationListener { - - private VerifyOperationHandler fileOpHandler; - - @Override - public void fileQoSVerificationRequested(QoSVerificationRequest request) { - fileOpHandler.handleUpdate(request.getUpdate()); - } - - @Override - public void fileQoSVerificationRequested(QoSScannerVerificationRequest request) { - fileOpHandler.handleVerificationRequest(request); - } - - @Override - public void fileQoSAdjustmentCompleted(QoSAdjustmentResponse response) { - fileOpHandler.handleAdjustmentResponse(response); - } - - @Override - public void fileQoSVerificationCancelled(PnfsId pnfsId, Subject subject) throws QoSException { - fileOpHandler.handleFileOperationCancelled(pnfsId); - } - - public void fileQoSBatchedVerificationCancelled(String pool) { - fileOpHandler.handleFileOperationsCancelledForPool(pool); - } - - public void notifyLocationExclusion(String location) { - fileOpHandler.handleExcludedStatusChange(location, true); - } - - public void notifyLocationInclusion(String location) { - fileOpHandler.handleExcludedStatusChange(location, false); - } - - public void setFileOpHandler(VerifyOperationHandler fileOpHandler) { - this.fileOpHandler = fileOpHandler; - } -} diff --git a/modules/dcache-qos/src/main/resources/org/dcache/qos/qos.xml b/modules/dcache-qos/src/main/resources/org/dcache/qos/qos.xml deleted file mode 100644 index f8ad2461146..00000000000 --- a/modules/dcache-qos/src/main/resources/org/dcache/qos/qos.xml +++ /dev/null @@ -1,620 +0,0 @@ - - - - - - - - - - - - - Communication stub for the QoS transition topic. - - - - - - - Communication stub for PnfsManager. - - - - - - - Communication stub for PinManager. - - - - - - - - Communication stub for pools. - - - - - - - - Client for requesting requirements from the local requirements service. - - - - - Client for communicating with local verifier service. - - - - - Client for communicating with local adjuster service. - - - - - Client for communicating with local scanner service. - - - - - - - - Handles message backlog when receivers are temporarily unavailable. - - - - - - - - - - Validates messages for handling; will ignore messages is message handling is - paused or if they originate with the qos service itself. - - - - - - - Tracks request message statistics. - - - - - - - - - - Processes incoming request messages. - - - - - - - - - - - - - Endpoint of this service for requests and updates; the QoS 'frontend'. - - - - - - The implementation of the rule engine for requirements. - - - - - - Commands for monitoring engine progress. - - - - - - - - Permission handler for requests to the namespace database. - - - - - - - - - - Wraps the namespace connection pool with an alarm handler. - - - - - - - Encapsulates the namespace database connection pool and properties. - - - - - - - - - - - - - - - - - - - - - - - Namespace database transaction manager. - - - - - File system implementation (Chimera). - - - - - - Namespace database storage info extractor. - - - - - - - Namespace database schema manager. - - - - - - - Implements provider API for namespace access. - - - - - - - - - - - - Specialized database access for qos scanning. - - - - - - - The main handler that manages the scanning operations. - - - - - - - - - - - - - - - - - - - - - - - - Tracks pool and system operation statistics. - - - - - Map of pool-specific operations which run location scans in response to state changes. - - - - - - - - - - - - - - - - - - Map of system-wide operations which run scans periodically. - - - - - - - - - - - - - - - - Handles responses updating system scans. - - - - - Handles responses updating pool scans. - - - - - Initializes internal maps in the proper order. - - - - - - - - - - - - - - - Processes Pool Monitor updates and refreshes/triggers the pool operations on that basis. - - - - - - - - - - - - Commands for monitoring, launching and canceling scan requests. - - - - - - - - - - - - - - - - - - Preserves the QOS session id generated for the task. - - - - - - - - - Constructs the necessary adjustment module on the basis of the request. - - - Preserves the QOS session id generated for the task. - - - - - - - - - - - - - - - - - - Tracks adjustment task statistics. - - - - - Processes the running adjustment tasks. - - - - - - - In-memory queues for running, ready and waiting adjustment tasks. - - - - - - - - - - - - - Circular buffer for holding the status of the most recently completed tasks. - - - - - Commands for monitoring and canceling adjustment tasks. - - - - - - - - - - Encapsulates the verifier database connection pool and properties. - - - - - - - - - - - - - - - - - - - - - - - - Verifier database schema manager. - - - - - - - Verifier data access object handler. - - - - - - Preserves the QOS session id generated for the operation. - - - - - - - - Determines what action to take based on requirements and current status of file. - - - - - - - - - - - - - - Mappings based on the Pool Selection Unit and Pool Monitor information - refreshed periodically, and optimized for the purposes of the verifier. - - - - Provides an in-memory façade to the underlying store in the form of a set of queues. - - - - - - - - Provides an in-memory API for accessing verification operations. - - - - - - - - - - - - - - Maintains state for ongoing batched verification requests from the scanner. - - - - - - - - - - - - Processes the running verification operation by obtaining requirements, - current file status and computation of the next action to be taken - (via the file-status-verifier). - - - - - - - - - - - - - - - - - - - - - - Tracks operation statistics. - - - - - Circular buffer for holding the status of the most recently completed operations. - - - - - Processes Pool Monitor updates and refreshes the internal pool information on that basis. - - - - - - - - - - - - - Initializes internal maps in the proper order. - - - - - - - - - - - - - - - Commands for monitoring, launching and canceling verification requests. - - - - - - - - - - - - diff --git a/skel/share/defaults/qos.properties b/skel/share/defaults/qos.properties index be8648b40b5..9fbe2311b4f 100644 --- a/skel/share/defaults/qos.properties +++ b/skel/share/defaults/qos.properties @@ -8,7 +8,7 @@ # ---- Cell names of qos services # -qos.cell.name=qos +(deprecated)qos.cell.name=qos # ---- Named queues to consume from # @@ -19,11 +19,11 @@ qos.cell.name=qos # This property contains a comma separated list of named queues to # consume from. # -qos.cell.consume = ${qos.cell.name} +(deprecated)qos.cell.consume = ${qos.cell.name} # ---- Message topics to subscribe to. # -qos.cell.subscribe=${qos.cache-location-topic},\ +(deprecated)qos.cell.subscribe=${qos.cache-location-topic},\ ${qos.corrupt-file-topic},\ ${qos.pool-monitor-topic} @@ -146,17 +146,17 @@ qos.service.scanner.timeout=1 qos.service.verification.timeout=1 (one-of?MILLISECONDS|SECONDS|MINUTES|HOURS|DAYS)qos.service.verification.timeout.unit=MINUTES -(deprecated)qos.adjuster.cell.consume=use qos-adjuster.cell.consume -(deprecated)qos.adjuster.cell.name=use qos-adjuster.cell.name -(deprecated)qos.db.verifier.connections.idle=use qos-verifier.db.connections.idle -(deprecated)qos.db.verifier.connections.max=use qos-verifier.db.connections.max -(deprecated)qos.db.verifier.fetch-size=use qos-verifier.db.fetch-size -(deprecated)qos.engine.cell.consume=use qos-engine.cell.consume -(deprecated)qos.engine.cell.name=use qos-engine.cell.name -(deprecated)qos.engine.cell.subscribe=use qos-engine.cell.subscribe -(deprecated)qos.scanner.cell.consume=use qos-scanner.cell.consume -(deprecated)qos.scanner.cell.name=use qos-scanner.cell.name -(deprecated)qos.scanner.cell.subscribe=use qos-scanner.cell.subscribe -(deprecated)qos.verifier.cell.consume=use qos-verifier.cell.consume -(deprecated)qos.verifier.cell.name=use qos-verifier.cell.name -(deprecated)qos.verifier.cell.subscribe=use qos-verifier.cell.subscribe \ No newline at end of file +(obsolete)qos.adjuster.cell.consume=use qos-adjuster.cell.consume +(obsolete)qos.adjuster.cell.name=use qos-adjuster.cell.name +(obsolete)qos.db.verifier.connections.idle=use qos-verifier.db.connections.idle +(obsolete)qos.db.verifier.connections.max=use qos-verifier.db.connections.max +(obsolete)qos.db.verifier.fetch-size=use qos-verifier.db.fetch-size +(obsolete)qos.engine.cell.consume=use qos-engine.cell.consume +(obsolete)qos.engine.cell.name=use qos-engine.cell.name +(obsolete)qos.engine.cell.subscribe=use qos-engine.cell.subscribe +(obsolete)qos.scanner.cell.consume=use qos-scanner.cell.consume +(obsolete)qos.scanner.cell.name=use qos-scanner.cell.name +(obsolete)qos.scanner.cell.subscribe=use qos-scanner.cell.subscribe +(obsolete)qos.verifier.cell.consume=use qos-verifier.cell.consume +(obsolete)qos.verifier.cell.name=use qos-verifier.cell.name +(obsolete)qos.verifier.cell.subscribe=use qos-verifier.cell.subscribe \ No newline at end of file diff --git a/skel/share/services/qos.batch b/skel/share/services/qos.batch deleted file mode 100644 index 642b0d3ea82..00000000000 --- a/skel/share/services/qos.batch +++ /dev/null @@ -1,88 +0,0 @@ -## QoS services - -onerror shutdown -check -strong qos.cell.name -check -strong qos.cell.consume -check -strong qos.cell.subscribe -check -strong qos.cache-location-topic -check -strong qos.corrupt-file-topic -check -strong qos.pool-monitor-topic -check -strong qos.transition-completed-topic -check -strong qos.home -check -strong qos.db.namespace.connections.max -check -strong qos.db.namespace.connections.idle -check -strong qos.db.namespace.fetch-size -check -strong qos.db.connections.max -check -strong qos.db.connections.idle -check -strong qos.db.fetch-size -check -strong qos.plugins.storage-info-extractor -check -strong qos.limits.requirements.submit-threads -check -strong qos.limits.verifier.submit-threads -check -strong qos.limits.verifier.bulk-threads -check -strong qos.limits.verifier.task-threads -check -strong qos.limits.verifier.remove-threads -check -strong qos.limits.adjuster.submit-threads -check -strong qos.limits.adjuster.task-threads -check -strong qos.limits.scanner.submit-threads -check -strong qos.limits.scanner.task-threads -check -strong qos.limits.verifier.max-running-operations -check -strong qos.limits.verifier.cache-capacity -check -strong qos.limits.adjuster.task-history -check -strong qos.limits.verifier.operation-history -check -strong qos.limits.verifier.operation-retries -check -strong qos.limits.adjuster.task-retries -check -strong qos.limits.verifier.scan-period -check -strong qos.limits.verifier.scan-period.unit -check -strong qos.limits.adjuster.scan-period -check -strong qos.limits.adjuster.scan-period.unit -check -strong qos.limits.pool-info-expiry -check -strong qos.limits.pool-info-expiry.unit -check -strong qos.limits.scanner.down-grace-period -check -strong qos.limits.scanner.down-grace-period.unit -check -strong qos.limits.scanner.restart-grace-period -check -strong qos.limits.scanner.restart-grace-period.unit -check -strong qos.limits.scanner.pool-op-init-grace-period -check -strong qos.limits.scanner.pool-op-init-grace-period.unit -check -strong qos.limits.scanner.pool-op-max-idle-time -check -strong qos.limits.scanner.pool-op-max-idle-time.unit -check -strong qos.limits.scanner.scan-period -check -strong qos.limits.scanner.scan-period.unit -check -strong qos.limits.scanner.online-window -check -strong qos.limits.scanner.online-window.unit -check -strong qos.limits.scanner.enable.nearline-scan -check -strong qos.limits.scanner.nearline-window -check -strong qos.limits.scanner.nearline-window.unit -check -strong qos.limits.scanner.online-batch-size -check -strong qos.limits.scanner.nearline-batch-size -check -strong qos.limits.startup-delay -check -strong qos.limits.startup-delay.unit -check -strong qos.limits.verifier.reload-grace-period -check -strong qos.limits.verifier.reload-grace-period.unit -check -strong qos.pool-selection-strategy -check -strong qos.service.pinmanager -check -strong qos.service.pinmanager.timeout -check -strong qos.service.pinmanager.timeout.unit -check -strong qos.service.pnfsmanager -check -strong qos.service.pnfsmanager.timeout -check -strong qos.service.pnfsmanager.timeout.unit -check -strong qos.service.pool.timeout -check -strong qos.service.pool.timeout.unit -check -strong qos.service.transition.timeout -check -strong qos.service.transition.timeout.unit -check -strong qos.service.requirements -check -strong qos.service.requirements.timeout -check -strong qos.service.requirements.timeout.unit -check -strong qos.service.adjustment -check -strong qos.service.adjustment.timeout -check -strong qos.service.adjustment.timeout.unit -check -strong qos.service.scanner -check -strong qos.service.scanner.timeout -check -strong qos.service.scanner.timeout.unit -check -strong qos.service.verification -check -strong qos.service.verification.timeout -check -strong qos.service.verification.timeout.unit - -create org.dcache.cells.UniversalSpringCell ${qos.cell.name} \ - "classpath:org/dcache/qos/qos.xml \ - -subscribe=${qos.cell.subscribe} \ - -consume=${qos.cell.consume}"