Last active
September 29, 2017 15:49
-
-
Save andreaceccanti/890cb9705a37a32c49f9f41a4324db99 to your computer and use it in GitHub Desktop.
StoRM PtP cleanup scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Selects and displays PtP requests that are stuck in progress for one month | |
SELECT rq.ID, rq.timeStamp, rp.targetSURL, sp.statusCode, sp.explanation | |
FROM storm_db.request_queue rq, storm_db.request_Put rp, storm_db.status_Put sp | |
WHERE rq.ID = rp.request_queueID and rp.ID = sp.request_PutID | |
and rq.status = 18 and rq.timeStamp <= DATE_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 MONTH); | |
-- Marks PtP requests stuck in progress for one month as expired, so that the StoRM | |
-- request garbage collector will remove them from the database | |
UPDATE storm_db.request_queue rq, storm_db.request_Put rp, storm_db.status_Put sp | |
SET sp.statusCode = 1, sp.explanation = "Request expired.", rq.status = 1 | |
WHERE rq.ID = rp.request_queueID and rp.ID = sp.request_PutID | |
and rq.status = 18 and rq.timeStamp <= DATE_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 MONTH); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment