-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docker/Dockerfile: revert setup this doesnt work idk why Signed-off-by: rkhapov <[email protected]> (cherry picked from commit 539fc03) * docker/reload: add reload with watchdog test There is problem with show clients and watchdog, added test will help to fix it in future commits Signed-off-by: rkhapov <[email protected]> * sources/storage.h: add storage link into watchdog To use it later Signed-off-by: rkhapov <[email protected]> * test-lag.sh: fix typo Signed-off-by: rkhapov <[email protected]> * sources/storage.c: fix use after free of storage in watchdog cycle, now storage deallocation waits for watchdog to finish Signed-off-by: rkhapov <[email protected]> * docker/Dockerfile: store gdb.py It is very usefull Signed-off-by: rkhapov <[email protected]> * test-reload.sh: remove dbg sleep Signed-off-by: rkhapov <[email protected]> * sources/router.c: fix client pool When routing failed, clients stayed in client pool, this can lead to use after free in case of no od_router_unroute Signed-off-by: rkhapov <[email protected]> * Makefile: add run_test_dbg Can be useful sometimes Signed-off-by: rkhapov <[email protected]> * sources/console.c: fix storage user len Signed-off-by: rkhapov <[email protected]> --------- Signed-off-by: rkhapov <[email protected]> Co-authored-by: rkhapov <[email protected]>
- Loading branch information
Showing
14 changed files
with
247 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test: show_clients reloads | ||
|
||
show_clients: | ||
/reload/reloads.sh | ||
|
||
reloads: | ||
/reload/show-clients.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
pid_file "/var/run/odyssey.pid" | ||
daemonize yes | ||
|
||
unix_socket_dir "/tmp" | ||
unix_socket_mode "0644" | ||
|
||
log_format "%p %t %l [%i %s] (%c) %m\n" | ||
|
||
log_to_stdout yes | ||
|
||
log_syslog no | ||
log_syslog_ident "odyssey" | ||
log_syslog_facility "daemon" | ||
|
||
log_debug yes | ||
log_config yes | ||
log_session yes | ||
log_query yes | ||
log_stats yes | ||
stats_interval 60 | ||
|
||
workers 5 | ||
resolvers 1 | ||
|
||
readahead 8192 | ||
|
||
cache_coroutine 0 | ||
|
||
coroutine_stack_size 8 | ||
|
||
nodelay yes | ||
|
||
keepalive 15 | ||
keepalive_keep_interval 75 | ||
keepalive_probes 9 | ||
|
||
keepalive_usr_timeout 0 | ||
|
||
|
||
listen { | ||
host "*" | ||
port 6432 | ||
backlog 128 | ||
} | ||
|
||
|
||
storage "postgres_server" { | ||
type "remote" | ||
host "localhost" | ||
port 5432 | ||
|
||
watchdog { | ||
authentication "none" | ||
|
||
storage "postgres_server" | ||
storage_db "postgres" | ||
storage_user "postgres" | ||
|
||
pool_routing "internal" | ||
pool "transaction" | ||
pool_size 10 | ||
|
||
pool_timeout 0 | ||
pool_ttl 1201 | ||
|
||
pool_discard yes | ||
pool_cancel yes | ||
|
||
server_lifetime 1901 | ||
log_debug no | ||
|
||
watchdog_lag_query "SELECT TRUNC(EXTRACT(EPOCH FROM NOW())) - 100" | ||
watchdog_lag_interval 10 | ||
} | ||
} | ||
|
||
database default { | ||
user default { | ||
authentication "none" | ||
|
||
storage "postgres_server" | ||
pool "transaction" | ||
pool_size 0 | ||
|
||
pool_timeout 0 | ||
|
||
pool_ttl 60 | ||
|
||
pool_discard no | ||
|
||
pool_cancel yes | ||
|
||
pool_rollback yes | ||
|
||
client_fwd_error yes | ||
|
||
application_name_add_host yes | ||
|
||
server_lifetime 3600 | ||
log_debug no | ||
|
||
quantiles "0.99,0.95,0.5" | ||
client_max 107 | ||
} | ||
} | ||
|
||
database "postgres" { | ||
user "user1" { | ||
authentication "none" | ||
storage "postgres_server" | ||
|
||
pool "transaction" | ||
pool_size 0 | ||
pool_timeout 0 | ||
pool_ttl 60 | ||
pool_discard no | ||
pool_cancel yes | ||
pool_rollback yes | ||
|
||
catchup_timeout 10 | ||
catchup_checks 10 | ||
|
||
client_fwd_error yes | ||
|
||
application_name_add_host yes | ||
|
||
server_lifetime 3600 | ||
log_debug no | ||
|
||
quantiles "0.99,0.95,0.5" | ||
client_max 107 | ||
} | ||
} | ||
storage "local" { | ||
type "local" | ||
} | ||
|
||
database "console" { | ||
user default { | ||
authentication "none" | ||
role "admin" | ||
pool "session" | ||
storage "local" | ||
} | ||
} | ||
|
||
|
||
locks_dir "/tmp/odyssey" | ||
|
||
graceful_die_on_errors yes | ||
enable_online_restart yes | ||
bindwith_reuseport yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
sleep 2 | ||
|
||
for run in {1..1000}; do | ||
kill -s HUP $(pidof odyssey) || exit 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
sleep 1 | ||
|
||
for run in {1..1000}; do | ||
PGPASSWORD=lolol psql -h localhost -p6432 -dconsole -Uuser1 -c 'show clients' 1>/dev/null | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash -x | ||
|
||
/usr/bin/odyssey /etc/odyssey/reload-config.conf | ||
|
||
make -j 2 -f /reload/Makefile || { | ||
echo "ERROR: simultaneous reloads with 'show clients' failed" | ||
|
||
cat /var/log/odyssey.log | ||
echo " | ||
" | ||
cat /var/log/postgresql/postgresql-16-main.log | ||
|
||
exit 1 | ||
} | ||
|
||
ody-stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters