-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add_groups
- Loading branch information
Showing
26 changed files
with
458 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
kill $(pgrep odyssey) || (sleep 1 && kill -9 $(pgrep odyssey)) || true | ||
pkill odyssey || (sleep 1 && kill -9 $(pgrep odyssey)) || true |
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,47 @@ | ||
pid_file "/var/run/odyssey.pid" | ||
daemonize yes | ||
|
||
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 | ||
|
||
|
||
listen { | ||
host "*" | ||
port 6432 | ||
backlog 128 | ||
} | ||
|
||
|
||
storage "postgres_server" { | ||
type "remote" | ||
host "localhost" | ||
port 5432 | ||
} | ||
|
||
database default { | ||
user default { | ||
authentication "none" | ||
storage "postgres_server" | ||
pool "transaction" | ||
pool_size 10 | ||
pool_timeout 3000 # We expect 3 clients to do pg_sleep(1) each. Extra second to suppress falpping. | ||
} | ||
} | ||
|
||
storage "local" { | ||
type "local" | ||
} | ||
|
||
|
||
locks_dir "/tmp/odyssey" |
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,23 @@ | ||
#!/bin/bash -x | ||
set -e | ||
ody-stop | ||
|
||
# We set pool size to 1 and check that 3 clients can do pg_sleep(1) at once. | ||
# We expect them to wait serially on 1 backend. | ||
|
||
/usr/bin/odyssey /shell-test/pool_size.conf | ||
|
||
|
||
for _ in $(seq 1 300); do | ||
psql -h 0.0.0.0 -p 6432 -c 'select pg_sleep(0.1)' -U user1 -d postgres & | ||
done | ||
|
||
for _ in $(seq 1 300); do | ||
wait -n || { | ||
code="$?" | ||
([[ $code = "127" ]] && exit 0 || exit "$code") | ||
break | ||
} | ||
done; | ||
|
||
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
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ od_bucket_t *od_bucket_create(void) | |
return b; | ||
} | ||
|
||
free(b); | ||
return NULL; | ||
} | ||
|
||
|
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
Oops, something went wrong.