From: jenkins-bot Date: Wed, 20 Mar 2013 13:20:17 +0000 (+0000) Subject: Merge "A few minor doc group tweaks." X-Git-Tag: 1.31.0-rc.0~20274 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=9e708b90a8f55fed83fa92cb6b3def5ec14356d2;p=lhc%2Fweb%2Fwiklou.git Merge "A few minor doc group tweaks." --- 9e708b90a8f55fed83fa92cb6b3def5ec14356d2 diff --cc includes/job/JobQueueRedis.php index cfdb8671b3,2d4edc52f7..338dc79055 --- a/includes/job/JobQueueRedis.php +++ b/includes/job/JobQueueRedis.php @@@ -24,34 -24,8 +24,35 @@@ /** * Class to handle job queues stored in Redis * + * This is faster, less resource intensive, queue that JobQueueDB. + * All data for a queue using this class is placed into one redis server. + * + * There are seven main redis keys used to track jobs: + * - l-unclaimed : A list of job IDs used for push/pop + * - z-claimed : A sorted set of (job ID, UNIX timestamp as score) used for job retries + * - z-abandoned : A sorted set of (job ID, UNIX timestamp as score) used for broken jobs + * - h-idBySha1 : A hash of (SHA1 => job ID) for unclaimed jobs used for de-duplication + * - h-sha1Byid : A hash of (job ID => SHA1) for unclaimed jobs used for de-duplication + * - h-attempts : A hash of (job ID => attempt count) used for job claiming/retries + * - h-data : A hash of (job ID => serialized blobs) for job storage + * Any given job ID can be in only one of l-unclaimed, z-claimed, and z-abandoned. + * If an ID appears in any of those lists, it should have a h-data entry for its ID. + * If a job has a non-empty SHA1 de-duplication value and its ID is in l-unclaimed, + * then there should be no other such jobs. Every h-idBySha1 entry has an h-sha1Byid + * entry and every h-sha1Byid must refer to an ID that is l-unclaimed. If a job has its + * ID in z-claimed or z-abandoned, then it must also have an h-attempts entry for its ID. + * + * Additionally, "rootjob:* keys to track "root jobs" used for additional de-duplication. + * Aside from root job keys, all keys have no expiry, and are only removed when jobs are run. + * All the keys are prefixed with the relevant wiki ID information. + * + * This class requires Redis 2.6 as it makes use Lua scripts for fast atomic operations. + * Additionally, it should be noted that redis has different persistence modes, such + * as rdb snapshots, journaling, and no persistent. Appropriate configuration should be + * made on the servers based on what queues are using it and what tolerance they have. + * * @ingroup JobQueue + * @ingroup Redis * @since 1.21 */ class JobQueueRedis extends JobQueue {