github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/state/globalclock/doc.go (about)

     1  // Copyright 2017 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  /*
     5  
     6  Package globalclock provides clients for updating and reading the
     7  global virtual time, stored in the MongoDB database.
     8  
     9  Multiple global clock updaters may run concurrently, but concurrent
    10  updates will fail. This simplifies failover in a multi-node controller,
    11  while preserving the invariant that a global clock second is at least
    12  as long as a wall-clock second.
    13  
    14  Schema design
    15  -------------
    16  
    17  We maintain a single collection, with a single document containing
    18  the current global time. Whenever time is to be advanced, we update
    19  the document while ensuring that the global time has not advanced by
    20  any other updater.
    21  
    22  */
    23  package globalclock