feat(duplication): add options to support cluster name only used for duplication and allow any other cluster id except myself to be ignored (#2000)

The purpose of this PR is to optimize configurations for duplications.

Firstly, many Pegasus clusters are configured with the same `cluster_name`
(namely `[replication]cluster_name`). However, once we decide to duplicate
tables between them, their `cluster_name` have to be changed to be distinguished
from each other -- this might lead to side effects.

Secondly, consider a scenario where many clusters are duplicated to a target
cluster. This means we have to add many cluster ids to the `*.ini` file of the target
cluster, and the target cluster might be restarted very frequently.

Thus following options are added to solve both problems:

```diff
[replication]
+ dup_cluster_name =
+ dup_ignore_other_cluster_ids = false
```

`[replication]dup_cluster_name` is added only for duplication in case `cluster_name`
has to be changed, while `[replication]dup_ignore_other_cluster_ids` is added so that
only the target cluster id should be configured and there is no need to add any other
cluster id.
15 files changed
tree: 038a4964c297b6c6504eec1c20a16686daaa0acf
  1. .devcontainer/
  2. .github/
  3. admin-cli/
  4. cmake_modules/
  5. collector/
  6. docker/
  7. docs/
  8. go-client/
  9. idl/
  10. java-client/
  11. nodejs-client/
  12. pegic/
  13. python-client/
  14. rfcs/
  15. scala-client/
  16. scripts/
  17. src/
  18. thirdparty/
  19. .asf.yaml
  20. .clang-format
  21. .gitignore
  22. .golangci.yml
  23. .licenserc.yaml
  24. .rat-excludes
  25. CMakeLists.txt
  26. DISCLAIMER
  27. HISTORY.md
  28. LICENSE
  29. NOTICE
  30. README.md
  31. run.sh
README.md

pegasus-logo

Lint and build regularly License Releases

Note: The master branch may be in an unstable or even in a broken state during development. Please use GitHub Releases instead of the master branch in order to get stable binaries.

Apache Pegasus is a distributed key-value storage system which is designed to be:

  • horizontally scalable: distributed using hash-based partitioning
  • strongly consistent: ensured by PacificA consensus protocol
  • high-performance: using RocksDB as underlying storage engine
  • simple: well-defined, easy-to-use APIs

Background

Pegasus targets to fill the gap between Redis and HBase. As the former is in-memory, low latency, but does not provide a strong-consistency guarantee. And unlike the latter, Pegasus is entirely written in C++ and its write-path relies merely on the local filesystem.

Apart from the performance requirements, we also need a storage system to ensure multiple-level data safety and support fast data migration between data centers, automatic load balancing, and online partition split.

Features

  • Persistence of data: Each write is replicated three-way to different ReplicaServers before responding to the client. Using PacificA protocol, Pegasus has the ability for strong consistent replication and membership changes.

  • Automatic load balancing over ReplicaServers: Load balancing is a builtin function of MetaServer, which manages the distribution of replicas. When the cluster is in an inbalance state, the administrator can invoke a simple rebalance command that automatically schedules the replica migration.

  • Cold Backup: Pegasus supports an extensible backup and restore mechanism to ensure data safety. The location of snapshot could be a distributed filesystem like HDFS or local filesystem. The snapshot storing in the filesystem can be further used for analysis based on pegasus-spark.

  • Eventually-consistent intra-datacenter replication: This is a feature we called duplication. It allows a change made in the local cluster accesible after a short time period by the remote cluster. It help achieving higher availability of your service and gaining better performance by accessing only local cluster.

To start using Pegasus

See our documentation on the Pegasus Website.

Client drivers

Pegasus has support for several languages:

Contact us

  • Send emails to the Apache Pegasus developer mailing list: dev@pegasus.apache.org. This is the place where topics around development, community, and problems are officially discussed. Please remember to subscribe to the mailing list via dev-subscribe@pegasus.apache.org.

  • GitHub Issues: submit an issue when you have any idea to improve Pegasus, and when you encountered some bugs or problems.

Related Projects

Test tools:

Data import/export tools:

License

Copyright 2022 The Apache Software Foundation. Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0