Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0e57e6b

Browse files
committed
Update README
1 parent f2a724e commit 0e57e6b

File tree

2 files changed

+28
-51
lines changed

2 files changed

+28
-51
lines changed

contrib/mmts/README.md

+23-49
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@ Multi-master is an extension and set of patches to a Postegres database, that tu
44
synchronous shared-nothing cluster to provide OLTP scalability and high availability with automatic
55
disaster recovery.
66

7-
8-
97
## Features
108

119
* Cluster-wide transaction isolation
1210
* Synchronous logical replication
1311
* DDL Replication
14-
* Distributed sequences
1512
* Fault tolerance
1613
* Automatic node recovery
1714

18-
19-
2015
## Overview
2116

2217
Multi-master replicates same database to all nodes in cluster and allows writes to each node. Transaction
@@ -65,62 +60,51 @@ After that everything is ready to install postgres along with extensions
6560
git clone https://github.com/postgrespro/postgres_cluster.git
6661
cd postgres_cluster
6762
./configure && make && make -j 4 install
68-
cd ./contrib/raftable && make install
6963
cd ../../contrib/mmts && make install
7064
```
7165

7266
### Docker
7367

74-
Directort contrib/mmts also includes Dockerfile that is capable of building multi-master and starting 3 node cluster.
68+
Directory contrib/mmts also includes docker-compose.yml that is capable of building multi-master and starting 3 node cluster.
7569

7670
```sh
7771
cd contrib/mmts
78-
docker-compose build
7972
docker-compose up
8073
```
8174

8275
### PgPro packages
8376

8477
After things go more stable we will release prebuilt packages for major platforms.
8578

86-
87-
8879
## Configuration
8980

9081
1. Add these required options to the `postgresql.conf` of each instance in the cluster.
91-
9282
```sh
93-
max_prepared_transactions = 200 # should be > 0, because all
94-
# transactions are implicitly two-phase
95-
max_connections = 200
96-
max_worker_processes = 100 # at least (2 * n + p + 1)
97-
# this figure is calculated as:
98-
# 1 raftable worker
99-
# n-1 receiver
100-
# n-1 sender
83+
wal_level = logical # multimaster is build on top of
84+
# logical replication and will not work otherwise
85+
max_connections = 100
86+
max_prepared_transactions = 300 # all transactions are implicitly two-phase, so that's
87+
# a good idea to set this equal to max_connections*N_nodes.
88+
max_wal_senders = 10 # at least the number of nodes
89+
max_replication_slots = 10 # at least the number of nodes
90+
max_worker_processes = 250 # Each node has:
91+
# N_nodes-1 receiver
92+
# N_nodes-1 sender
10193
# 1 mtm-sender
10294
# 1 mtm-receiver
103-
# p workers in the pool
104-
max_parallel_degree = 0
105-
wal_level = logical # multimaster is build on top of
106-
# logical replication and will not work otherwise
107-
max_wal_senders = 10 # at least the number of nodes
108-
wal_sender_timeout = 0
109-
default_transaction_isolation = 'repeatable read'
110-
max_replication_slots = 10 # at least the number of nodes
111-
shared_preload_libraries = 'raftable,multimaster'
112-
multimaster.workers = 10
113-
multimaster.queue_size = 10485760 # 10mb
114-
multimaster.node_id = 1 # the 1-based index of the node in the cluster
115-
multimaster.conn_strings = 'dbname=... host=....0.0.1 port=... raftport=..., ...'
116-
# comma-separated list of connection strings
117-
multimaster.use_raftable = true
118-
multimaster.heartbeat_recv_timeout = 1000
119-
multimaster.heartbeat_send_timeout = 250
120-
multimaster.ignore_tables_without_pk = true
121-
multimaster.twopc_min_timeout = 2000
95+
# Also transactions executed at neighbour nodes can cause spawn of
96+
# background pool worker at our node. At max this will be equal to
97+
# sum of max_connections on neighbour nodes.
98+
99+
100+
101+
shared_preload_libraries = 'multimaster'
102+
multimaster.max_nodes = 3 # cluster size
103+
multimaster.node_id = 1 # the 1-based index of the node in the cluster
104+
multimaster.conn_strings = 'dbname=mydb host=node1.mycluster, ...'
105+
# comma-separated list of connection strings to neighbour nodes.
122106
```
123-
1. Allow replication in `pg_hba.conf`.
107+
2. Allow replication in `pg_hba.conf`.
124108

125109
Read description of all configuration params at [configuration](/contrib/mmts/doc/configuration.md)
126110

@@ -147,16 +131,6 @@ Read description of all management functions at [functions](/contrib/mmts/doc/fu
147131

148132
(Link to test/failure matrix)
149133

150-
### Postgres compatibility
151-
152-
Regression: 141 of 164
153-
Isolation: n/a
154-
155-
To run tests:
156-
* `make -C contrib/mmts check` to run TAP-tests.
157-
* `make -C contrib/mmts xcheck` to run blockade tests. The blockade tests require `docker`, `blockade`, and some other packages installed, see [requirements.txt](tests2/requirements.txt) for the list. You might also want to gain superuser privileges to run these tests successfully.
158-
159-
160134

161135
## Limitations
162136

contrib/mmts/multimaster.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,9 @@ bool MtmRecoveryCaughtUp(int nodeId, XLogRecPtr slotLSN)
16571657
BIT_SET(Mtm->walSenderLockerMask, MyWalSnd - WalSndCtl->walsnds);
16581658
Mtm->nLockers += 1;
16591659
} else {
1660-
MTM_LOG2("Continue recovery of node %d, slot position %lx, WAL position %lx, WAL sender position %lx, lockers %d, active transactions %d", nodeId, slotLSN, walLSN, MyWalSnd->sentPtr, Mtm->nLockers, Mtm->nActiveTransactions);
1660+
MTM_LOG2("Continue recovery of node %d, slot position %lx, WAL position %lx,"
1661+
" WAL sender position %lx, lockers %d, active transactions %d", nodeId, slotLSN,
1662+
walLSN, MyWalSnd->sentPtr, Mtm->nLockers, Mtm->nActiveTransactions);
16611663
}
16621664
}
16631665
MtmUnlock();
@@ -2608,7 +2610,8 @@ _PG_init(void)
26082610

26092611
DefineCustomIntVariable(
26102612
"multimaster.max_2pc_ratio",
2611-
"Maximal ratio (in percents) between prepare time at different nodes: if T is time of preparing transaction at some node, then transaction can be aborted if prepared responce was not received in T*MtmMax2PCRatio/100",
2613+
"Maximal ratio (in percents) between prepare time at different nodes: if T is time of preparing transaction at some node,"
2614+
" then transaction can be aborted if prepared responce was not received in T*MtmMax2PCRatio/100",
26122615
NULL,
26132616
&MtmMax2PCRatio,
26142617
200, /* 2 times */

0 commit comments

Comments
 (0)