Comments (1)
Hey @jberkus,
We have been thinking of ways to properly support multiple master nodes for a while. We're looking at this issue in two dimensions.
The first dimension involves a side-effect of how we currently handle Insert failures. Today, if we fail to write to a shard, we have to update its corresponding metadata. When the node that routes the write request and the one that holds the metadata are the same, that's easy. When they are different, we need to think more. On this one, we'll investigate the approach BDR takes more, and see if we can guarantee propagating changes to metadata.
Of course, if the previous requirement ends up being too burdensome, we can also look into relaxing it.
The second dimension relates more to usability. We have a small amount of metadata that changes infrequently. Do we want to have one node, multiple nodes, or all nodes to have a copy of that metadata? A few rough architectural ideas there are (more to brainstorm on):
- Can we model each metadata change as a separate event? Each node then reconciles all metadata change events that it has access to, and reconstructs its metadata. This approach has the drawback that end users may observe "eventually consistent" results.
- We remove the "shard state" field from authoritative metadata. If a shard is replicated to node A, B, and C, we then say these three nodes form a replica group. Each replica group chooses its own leader and follower through a distributed consensus algorithm (Raft), and ensures that writes coming to a replica group are correctly propagated. This approach has the drawback that it requires a fair amount of coding.
- Each worker node "leases" metadata from the master node. When the worker receives a write, it tries to forward it to the correct replicas. If that fails, it asks the master node to update the metadata. This approach has the drawback that there is a window where the first time the master node's metadata needs to be updated, if the worker loses the connection to the master, the metadata goes out of sync. We may introduce pings in here to dramatically reduce this window, but it's still theoretically not safe.
Just a few brainstorming ideas over the weekend for now.
from pg_shard.
Related Issues (20)
- Allow IMMUTABLE functions in modification commands HOT 8
- DISTINCT and JSON field selection HOT 2
- Does pg_shard support user defined functions? HOT 3
- Does pg_shard encrypt the messages between nodes? HOT 3
- build issue HOT 2
- Support UNLOGGED tables HOT 2
- Schema support incomplete? HOT 1
- Support RETURNING in modification commands HOT 3
- sync-metadata does not support quoted column names HOT 1
- Zapier Test
- Default to CitusDB SELECT plan when within CitusDB
- Let CitusDB invalidate pg_shard's shard interval cache
- Make zero-shard SELECT consistent with CitusDB
- Support "UPSERT"
- Support prepared statements HOT 2
- 1.2.1 build error against PostgreSQL 9.4 HOT 5
- 1.2.1 build error against PostgreSQL 9.5 HOT 2
- cant read data from master [issue moved to pg_shard mailing list]
- Cannot read data in partition sets HOT 3
- Handling bigserial / auto-increment [Moved to mailing list] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pg_shard.