@@ -22,8 +22,9 @@ which is useful for development.
22
22
Both shardlord and workers require extension built and installed. We depend
23
23
on pg_pathman extension so it must be installed too.
24
24
PostgreSQL location for building is derived from pg_config, you can also specify
25
- path to it in PG_CONFIG var. PostgreSQL 10 (master branch as of writing this)
26
- is required. The whole process of building and copying files to PG server is just:
25
+ path to it in PG_CONFIG var. PostgreSQL 10 (REL_10_STABLE branch as of writing
26
+ this) is required. Extension links with libpq, so if you The whole process of
27
+ building and copying files to PG server is just:
27
28
28
29
git clone
29
30
cd pg_shardman
@@ -85,9 +86,9 @@ that's easy to change.
85
86
Let's get to the actual commands.
86
87
87
88
add_node(connstring text)
88
- Add node with given connstring to the cluster. Node is assigned unique id. If
89
- node previously contained shardman state from old cluster (not one managed by
90
- current shardlord), this state will be lost.
89
+ Add node with given libpq connstring to the cluster. Node is assigned unique
90
+ id. If node previously contained shardman state from old cluster (not one
91
+ managed by current shardlord), this state will be lost.
91
92
92
93
rm_node(node_id int)
93
94
Remove node from the cluster. Its shardman state will be reset. We don't delete
@@ -163,15 +164,20 @@ warnings about failed moves during execution. After completion cmd status is
163
164
164
165
set_replevel(relation text, replevel int)
165
166
Add replicas to shards of sharded table 'relation' until we reach replevel
166
- replicas for each one. Replica deletions is not implemented yet. Note that it is
167
- pointless to set replevel to more than number of active workers - 1 since we
167
+ replicas for each one, i.e. until each shard has 'replevel' read-only replicas.
168
+ replevel 0 has no effect. Replica deletions is not implemented yet. Note that it
169
+ is pointless to set replevel more than number of active workers - 1 since we
168
170
don't forbid several replicas on one node. Nodes for replicas are choosen
169
171
randomly. As in 'rebalance', we are fully oblivious about current shards
170
- distribution, so you will see a bunch of warnings about failing replica
171
- creation -- one for each time random chooses node with already existing replica.
172
+ distribution, so you will see a bunch of warnings about failing replica creation
173
+ -- one for each time random had chosen node with already existing replica.
172
174
173
175
Sharded tables dropping, as well as replica deletion is not implemented yet.
174
176
177
+ Note on permissions: since creating subscription requires superuser priviliges,
178
+ connections strings provided to add_node, as well as shardlord_connstring GUC
179
+ must be of superuser ones. This might be relaxed in the future.
180
+
175
181
Limitations:
176
182
* We are bound to Linux since we use epoll, select should be added.
177
183
* We can't switch shardlord for now.
0 commit comments