@@ -238,12 +238,13 @@ This store does not support blocking, and expects a TTL to avoid stalled locks::
238
238
239
239
The ``MongoDbStore `` takes the following ``$options ``:
240
240
241
- =========== ========= ====================================
242
- Option Default Description
243
- =========== ========= ====================================
244
- database The name of the database [Mandatory]
245
- collection ``lock `` The name of the collection
246
- =========== ========= ====================================
241
+ ========== ======== =============================================================
242
+ Option Default Description
243
+ ========== ======== =============================================================
244
+ database The name of the database [Mandatory]
245
+ collection ``lock `` The name of the collection
246
+ drift ``0.0 `` Seconds to extend expiries to account for clock discrepancies
247
+ ========== ======== =============================================================
247
248
248
249
.. _lock-store-redis :
249
250
@@ -469,24 +470,27 @@ inclusive of structural overhead.
469
470
470
471
For more details see: https://docs.mongodb.com/manual/reference/limits/#Index-Key-Limit
471
472
473
+ Please be aware, MongoDbStore relies on clock syncronisation between
474
+ the application nodes and mongodb servers. The ``drift `` option can be used
475
+ to extend expiries to account for clock discrepancies.
476
+
472
477
A TTL index MUST BE used on MongoDB 2.2+ to automatically clean up expired locks.
473
- Please be aware any clock drift between the application and mongo servers could
474
- cause locks to be released prematurely. To account for any drift;
475
- expireAfterSeconds can be set to a value higher than 0. The logical expiry of
476
- locks is handled by the application so setting a higher ``expireAfterSeconds ``
477
- has no effect other than keeping stale data for longer.
478
478
479
479
Such an index can for example look like this:
480
480
481
481
.. code-block :: javascript
482
482
483
483
db .lock .ensureIndex (
484
484
{ " expires_at" : 1 },
485
- { " expireAfterSeconds" : 60 }
485
+ { " expireAfterSeconds" : 0 }
486
486
)
487
487
488
488
For more details see: http://docs.mongodb.org/manual/tutorial/expire-data/
489
489
490
+ writeConcern, readConcern and readPreference are not specified by MongoDbStore
491
+ meaning the collection's settings will take effect.
492
+ For more details see: https://docs.mongodb.com/manual/applications/replication/
493
+
490
494
RedisStore
491
495
~~~~~~~~~~
492
496
0 commit comments