Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best-Effort durability semantics #45

Open
mnunberg opened this issue May 19, 2016 · 0 comments
Open

Best-Effort durability semantics #45

mnunberg opened this issue May 19, 2016 · 0 comments

Comments

@mnunberg
Copy link
Contributor

Currently the Python SDK allows one to specify a -1 value for either persist_to or replicate_to. When this is specified, the SDK will attempt to use the maximum number of servers/replicas available for durability requirements.

In pseudo code, it might look like the following

def get_durability_requirements(self, persist_to, replicate_to):
  max_persist = self.replica_count + 1
  max_persist = min(max_persist, self.nodes_online)

  max_replica = max_persist - 1

  if persist_to < 0:
    persist_to = max_persist
  if replicate_to < 0:
    replicate_to = max_replica

  return persist_to, replicate_to

This basically allows users to worry less about the topology of their cluster, with the assumed risk that if there are no replicas online then they would be running without a replica copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant