1 library(paxos): A Replicated Data Store
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • Paxos -- a SWI-Prolog replicating key-value store
        • library(paxos): A Replicated Data Store
          • paxos_initialize/1
          • paxos_property/1
          • paxos_set/1
          • paxos_set/2
          • paxos_set/3
          • paxos_quorum_ask/4
          • paxos_get/1
          • paxos_get/2
          • paxos_get/3
          • paxos_replicate_key/3
          • paxos_on_change/2
          • paxos_on_change/3
          • paxos_ledger_hook/5
Availability::- use_module(library(paxos)).(can be autoloaded)
Source[semidet]paxos_set(+Key, +Value)
[semidet]paxos_set(+Key, +Value, +Options)
negotiates to have Key-Value recorded in the ledger for each of the quorum's members. This predicate succeeds if the quorum unanimously accepts the proposed term. If no such entry exists in the Paxon's ledger, then one is silently created. paxos_set/1 will retry the transaction several times (default: 20) before failing. Failure is rare and is usually the result of a collision of two or more writers writing to the same term at precisely the same time. On failure, it may be useful to wait some random period of time, and then retry the transaction. By specifying a retry count of zero, paxos_set/2 will succeed iff the first ballot succeeds.

On success, paxos_set/1 will also broadcast the term paxos_changed(Key,Value), to the quorum.

Options processed:

retry(Retries)
is a non-negative integer specifying the number of retries that will be performed before a set is abandoned. Defaults to the setting max_sets (20).
timeout(+Seconds)
Max time to wait for the forum to reply. Defaults to the setting response_timeout (0.020, 20ms).
Term is a compound that may have unbound variables.
To be done
If the Value is already current, should we simply do nothing?