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

Commit f2f46a0

Browse files
committed
2 parents f96d97b + 3c7a555 commit f2f46a0

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

contrib/mmts/Cluster.pm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ sub configure
105105
multimaster.heartbeat_send_timeout = 250
106106
multimaster.ignore_tables_without_pk = true
107107
multimaster.twopc_min_timeout = 2000
108-
raftable.id = $id
109-
raftable.peers = '$raftpeers'
110108
));
111109

112110
$node->append_conf("pg_hba.conf", qq(

contrib/mmts/docker/docker-entrypoint.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ cat >> "$PGDATA/postgresql.conf" <<-EOF
3636
multimaster.conn_strings = '$CONNS'
3737
multimaster.use_raftable = true
3838
multimaster.ignore_tables_without_pk = true
39-
raftable.id = $NODEID
40-
raftable.peers = '$PEERS'
4139
EOF
4240

4341
"$@"

contrib/mmts/tests/reinit-mm.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ do
3636
sed "s/5432/$port/g" < postgresql.conf.mm > node$i/postgresql.conf
3737
echo "multimaster.conn_strings = '$conn_str'" >> node$i/postgresql.conf
3838
echo "multimaster.node_id = $i" >> node$i/postgresql.conf
39-
echo "raftable.id = $i" >> node$i/postgresql.conf
40-
echo "raftable.peers = '$raft_conn_str'" >> node$i/postgresql.conf
4139

4240
cp pg_hba.conf node$i
4341
pg_ctl -w -D node$i -l node$i.log start

contrib/mmts/tests2/client2.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self, name):
2020
def clear_values(self):
2121
self.max_latency = 0.0
2222
self.finish = {}
23-
23+
2424
def start_tx(self):
2525
self.start_time = datetime.datetime.now()
2626

@@ -34,7 +34,7 @@ def finish_tx(self, name):
3434
self.finish[name] = 1
3535
else:
3636
self.finish[name] += 1
37-
37+
3838
def as_dict(self):
3939
return {
4040
'running_latency': (datetime.datetime.now() - self.start_time).total_seconds(),
@@ -43,13 +43,24 @@ def as_dict(self):
4343
'finish': copy.deepcopy(self.finish)
4444
}
4545

46+
def keep_trying(tries, delay, method, name, *args, **kwargs):
47+
for t in range(tries):
48+
try:
49+
return method(*args, **kwargs)
50+
except Exception as e:
51+
if t == tries - 1:
52+
raise Exception("%s failed all %d tries" % (name, tries)) from e
53+
print("%s failed [%d of %d]: %s" % (name, t + 1, tries, str(e)))
54+
time.sleep(delay)
55+
raise Exception("this should not happen")
56+
4657
class MtmClient(object):
4758

4859
def __init__(self, dsns, n_accounts=100000):
4960
self.n_accounts = n_accounts
5061
self.dsns = dsns
5162
self.aggregates = {}
52-
self.initdb()
63+
keep_trying(40, 1, self.initdb, 'self.initdb')
5364
self.running = True
5465
self.nodes_state_fields = ["id", "disabled", "disconnected", "catchUp", "slotLag",
5566
"avgTransDelay", "lastStatusChange", "oldestSnapshot", "SenderPid",
@@ -175,7 +186,7 @@ def run(self):
175186
asyncio.async(self.status())
176187

177188
self.loop.run_forever()
178-
189+
179190
def bgrun(self):
180191
print('Starting evloop in different process');
181192
self.parent_pipe, self.child_pipe = aioprocessing.AioPipe()
@@ -189,7 +200,7 @@ def get_status(self):
189200
resp = self.parent_pipe.recv()
190201
print('test: got status response')
191202
return resp
192-
203+
193204
def stop(self):
194205
self.running = False
195206
self.evloop_process.terminate()

contrib/mmts/tests2/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if [ "${1:0:1}" = '-' ]; then
66
set -- postgres "$@"
77
fi
88

9-
sudo sh -c 'echo "/pg/%p.%s.%c.%P.core" > /proc/sys/kernel/core_pattern'
9+
#echo "/pg/%p.%s.%c.%P.core" | sudo tee /proc/sys/kernel/core_pattern
1010

1111
if [ "$1" = 'postgres' ]; then
1212
mkdir -p "$PGDATA"

contrib/mmts/tests2/provision.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@
132132
- "log_autovacuum_min_duration = 0"
133133
- "shared_preload_libraries = 'raftable,multimaster'"
134134
- "default_transaction_isolation = 'repeatable read'"
135-
- "raftable.id = {{ node_id }}"
136-
- "raftable.peers = '{{ raft_connstr }}'"
137135
- "multimaster.workers = 20"
138136
- "multimaster.arbiter_port = {{ 7777 }}"
139137
- "multimaster.use_raftable = true"

contrib/raftable/worker.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static void on_message_recv(Client *c)
237237
}
238238
else
239239
{
240-
elog(WARNING, "emitted raft update %d", index);
240+
elog(DEBUG1, "emitted raft update %d", index);
241241
c->expect = index;
242242
c->state = CLIENT_WAITING;
243243
}
@@ -298,7 +298,7 @@ static void attend(Client *c)
298298
if (c->state == CLIENT_SICK) return;
299299
if (!c->msg) return;
300300
if (c->cursor < c->msg->len) return;
301-
elog(WARNING, "got %d bytes from client", (int)c->cursor);
301+
elog(DEBUG1, "got %d bytes from client", (int)c->cursor);
302302
on_message_recv(c);
303303
break;
304304
case CLIENT_RECVING:
@@ -324,7 +324,7 @@ static void notify(void)
324324
Assert(c->expect >= 0);
325325
if (!raft_applied(raft, server.id, c->expect)) continue;
326326

327-
elog(WARNING, "notify client %d that update %d is applied", i, c->expect);
327+
elog(DEBUG1, "notify client %d that update %d is applied", i, c->expect);
328328
answer = make_single_value_message("", NULL, 0, &answersize);
329329
answer->meaning = MEAN_OK;
330330
c->msg = palloc(sizeof(Message) + answersize);

0 commit comments

Comments
 (0)