Skip to content

Commit a357229

Browse files
kofemannkhys95
authored andcommitted
qos: disable dynamic replica reduction
Motivation: Due to concurrent nature of message processing in dCache data migration by `migration move` command we might observe a raise condition between PIN and UNPIN operations, which might be sent and processed in different order. Thus UNPIN, followed by PIN, with expected result in file being pinned may be processed as PIN followed by UNPIN, with file ending in unpinned state. The reduction of pinned replicas on migration event can be skipped. The redundant pin will be adjusted by scanner on the next run. Modification: Skip unpinning if it's not done by scanner. Result: no danger in running into raise condition with a cost of redundant pinned replica for some period of time. Acked-by: Dmitry Litvintsev Target: master, 11.0, 10.2, 10.1, 10.0, 9.2 Require-book: no Require-notes: yes (cherry picked from commit ef27b1f) Signed-off-by: Tigran Mkrtchyan <[email protected]>
1 parent 45b0aea commit a357229

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

modules/dcache-qos/src/main/java/org/dcache/qos/services/verifier/handlers/FileStatusVerifier.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
8787
import org.dcache.cells.CellStub;
8888
import org.dcache.qos.data.FileQoSRequirements;
8989
import org.dcache.qos.data.QoSAction;
90+
import org.dcache.qos.data.QoSMessageType;
9091
import org.dcache.qos.services.verifier.data.PoolInfoMap;
9192
import org.dcache.qos.services.verifier.data.VerifiedLocations;
9293
import org.dcache.qos.services.verifier.data.VerifyOperation;
@@ -449,6 +450,18 @@ private Optional<QoSAction> checkForLocationAdjustment(FileQoSRequirements requi
449450
}
450451
}
451452

453+
// REVISIT: effectively disable adjustment if we need to reduce the number of replicas.
454+
//
455+
// This section is added due to race condition between PIN and UNPIN operations, which
456+
// may lead to PIN and UNPIN requests processed out of order. Thus UNPIN, followed by PIN, with
457+
// expected result in file being pinned may be processed as PIN followed by UNPIN, with
458+
// file ending in unpinned state.
459+
//
460+
// The redundant pinned copy will be reduced by scanner at the next run.
461+
if (missing < 0 && operation.getMessageType() != QoSMessageType.SYSTEM_SCAN) {
462+
missing = 0;
463+
}
464+
452465
operation.setNeeded(Math.abs(missing));
453466

454467
LOGGER.debug("{}, checkForLocationAdjustment; required {}, excluded {}, missing {}.",

0 commit comments

Comments
 (0)