Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
poolmanager: refactor stage check, fix some staging decisions
Motivation: The algorithm to check whether a file can be staged (i.e., file is stored on tape and poolmanager is configured to support staging) appears in several places. This violates the DRY principle. There are a few places where the FSM will attempt to stage a file even if that file isn't stored on tape: * If the initial check returns NOT_PERMITTED (replicas exist, but not accessible via any read-link selected for this request), staging is enabled and pool-to-pool transfers disabled. * If the initial check returns COST_EXCEEDED (only under classic partition, with cost exceeding cost-cut but without exceeding panic cost-cut), p2pOnCost is disabled, and both staging and stageOnCode are enabled. In both cases, FSM will attempt to stage files it knows are not stored on tape. (There is another, egregious place where FSM attempts to stage a non-tape file. This will be fixed in a subsequent patch.) This is bad as information the original error is lost when it is replaced with a generic (and unhelpful) staging error message. Modification: Rename an existing method (`canStage --> isStagingAllowed`) to better reflect that this method is an authorisation check. Create method to describe whether a file is stageable (`isFileStageable`). To be stageable a file must be stored on tape and poolmanager is configured to allow staging. For the two cases where FSM will attempt to stage files that are not stored on tape, this patch updates FSM to behave the same way for non-tape files, whether or not staging is enabled. In the NOT_PERMITTED case, with this patch FSM will attempt a pool-to-pool (despite p2p being disabled). In the COST_EXCEEDED case, with this patch FSM will fail the request. Result: No user observable changes. In some cases, poolmanager will report more useful error messages instead of the generic "No pool candidates available/configured/left for stage" message. Target: master Requires-notes: yes Requires-book: no Patch: https://rb.dcache.org/r/12815/ Acked-by: Tigran Mkrtchyan
- Loading branch information