couchbaselabs / couchbaselabs/sdk-rfcs

Best-Effort durability semantics

Open
#45 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
42
Forks
20
PR merge metrics
No merged PRs in 30d

Description

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

``` python
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.