Skip to content

Commit b579e25

Browse files
committed
wip
Signed-off-by: roman khapov <[email protected]>
1 parent 31daaf9 commit b579e25

File tree

5 files changed

+29
-13
lines changed

5 files changed

+29
-13
lines changed

docker/functional/tests/lagpolling/lag-conf.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ database "postgres" {
112112
authentication "none"
113113
storage "postgres_server"
114114

115-
pool "transaction"
115+
pool "session"
116116
pool_size 0
117117
pool_timeout 0
118118
pool_ttl 60

docker/functional/tests/lagpolling/runner.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash -x
22

33

4+
# disable options for this run
5+
# because it has some bug that leads to odyssey connection stuck
6+
# if options is defined
47
/usr/bin/odyssey /tests/lagpolling/lag-conf.conf
58
sleep 3
69

@@ -16,16 +19,24 @@ for _ in $(seq 1 3); do
1619
PGPASSWORD=lolol psql -h localhost -p6432 -dpostgres -Uuser1 -c 'select 3' || exit 1
1720
done
1821

19-
service postgresql restart || true
22+
# sudo -u postgres /usr/lib/postgresql/16/bin/pg_ctl -D /var/lib/postgresql/16/repl/ restart
23+
# until pg_isready -h localhost -p 5433 -U postgres -d postgres; do
24+
# echo "Wait for replica..."
25+
# sleep 1
26+
# done
2027

21-
sleep 1
28+
# sudo -u postgres /usr/lib/postgresql/16/bin/pg_ctl -D /var/lib/postgresql/16/main/ restart
29+
# until pg_isready -h localhost -p 5432 -U postgres -d postgres; do
30+
# echo "Wait for primary..."
31+
# sleep 1
32+
# done
2233

23-
PGPASSWORD=lolol psql -h localhost -p6432 -dpostgres -Uuser1 -c 'select 3' || exit 1
34+
# PGPASSWORD=lolol timeout 1s psql -h localhost -p6432 -dpostgres -Uuser1 -c 'select 3' || exit 1
2435

25-
# test bad backend connections closed properly
36+
# # test bad backend connections closed properly
2637

27-
for _ in $(seq 1 3); do
28-
PGPASSWORD=lolol psql -h localhost -p6432 -dpostgres -Uuser1 -c 'select 3' || exit 1
29-
done
38+
# for _ in $(seq 1 3); do
39+
# PGPASSWORD=lolol timeout 1s psql -h localhost -p6432 -dpostgres -Uuser1 -c 'select 3' || exit 1
40+
# done
3041

3142
ody-stop

sources/config.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ void od_config_free(od_config_t *config)
9292
listen = od_container_of(i, od_config_listen_t, link);
9393
od_config_listen_free(listen);
9494
}
95+
if (config->unix_socket_mode) {
96+
od_free(config->unix_socket_mode);
97+
}
9598
if (config->log_file)
9699
od_free(config->log_file);
97100
if (config->log_format)
@@ -106,8 +109,8 @@ void od_config_free(od_config_t *config)
106109
od_free(config->log_syslog_facility);
107110
if (config->locks_dir) {
108111
od_free(config->locks_dir);
109-
if (config->hba_file)
110-
od_free(config->hba_file);
112+
if (config->hba_file)
113+
od_free(config->hba_file);
111114
}
112115
if (config->external_auth_socket_path)
113116
od_free(config->external_auth_socket_path);

sources/frontend.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ od_frontend_check_replica_catchup(od_instance_t *instance, od_client_t *client)
20322032
static int wait_client_activity(od_client_t *client)
20332033
{
20342034
/* io_cond is set up by client or server relay */
2035-
if (machine_cond_wait(client->io_cond, 10 * 1000 /* 10 sec */) == 0) {
2035+
if (machine_cond_wait(client->io_cond, 1 * 1000 /* 10 sec */) == 0) {
20362036
client->time_last_active = machine_time_us();
20372037
od_dbg_printf_on_dvl_lvl(
20382038
1, "change client last active time %lld\n",
@@ -2041,6 +2041,8 @@ static int wait_client_activity(od_client_t *client)
20412041
return 1;
20422042
}
20432043

2044+
od_log(&od_global_get()->instance->logger, "HUI", client, client->server, "waiting for activity");
2045+
20442046
return 0;
20452047
}
20462048

sources/router.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,8 @@ void od_router_detach(od_router_t *router, od_client_t *client)
785785
client->server = NULL;
786786
server->client = NULL;
787787

788-
machine_cond_propagate(server->io.on_read, NULL);
789-
machine_cond_propagate(server->io.on_write, NULL);
788+
// machine_cond_propagate(server->io.on_read, NULL);
789+
// machine_cond_propagate(server->io.on_write, NULL);
790790

791791
if (od_likely(!server->offline)) {
792792
od_instance_t *instance = server->global->instance;

0 commit comments

Comments
 (0)