diff --git a/citus_dev/citus_dev b/citus_dev/citus_dev index 6398c906..a4c46cbc 100755 --- a/citus_dev/citus_dev +++ b/citus_dev/citus_dev @@ -2,7 +2,7 @@ """citus_dev Usage: - citus_dev make [--size=] [--port=] [--use-ssl] [--no-extension] [--mx] [--destroy] [--init-with=] [--init-worker-with=] [--with-pgbouncer] + citus_dev make [--size=] [--port=] [--use-ssl] [--no-extension] [--mx] [--destroy] [--init-with=] [--init-worker-with=] [--with-pgbouncer] [--with-shared-preloaded-libs=] citus_dev restart [--watch] [--port=] citus_dev (start|stop) [--port=] [--force] @@ -18,6 +18,7 @@ Options: --init-worker-with= A SQL script to run after creation of the cluster on the workers --with-pgbouncer Setup pgbouncers between worker and coordinator (requires citus enterprise) --force Forceful shutdown + --with-shared-preloaded-libs= Comma separated list of extra shared preload libraries to be added to postgresql.conf of each node """ from docopt import docopt @@ -45,7 +46,7 @@ def run(command, *args, **kwargs): return result -def createNodeCommands(clustername, role, index=None, usessl=False, mx=False): +def createNodeCommands(clustername, role, index=None, usessl=False, mx=False, extra_preloaded_libraries=None): nodename = role if index != None: nodename += "%d" % index @@ -53,6 +54,9 @@ def createNodeCommands(clustername, role, index=None, usessl=False, mx=False): run(f"initdb -D {clustername}/{nodename}") shared_preload_libraries = ['citus', 'pg_stat_statements'] + + if extra_preloaded_libraries: + shared_preload_libraries.extend(extra_preloaded_libraries) shared_preload_libraries = ','.join(shared_preload_libraries) @@ -110,13 +114,17 @@ def main(arguments): if arguments['--destroy']: stopCluster(clustername, True) run(f'rm -rf {clustername}') - + + extra_preloaded_libraries = [] + if arguments["--with-shared-preloaded-libs"]: + extra_preloaded_libraries = arguments["--with-shared-preloaded-libs"] createNodeCommands( clustername, "coordinator", usessl=arguments["--use-ssl"], mx=arguments["--mx"], + extra_preloaded_libraries=extra_preloaded_libraries ) port = int(arguments["--port"]) @@ -133,6 +141,7 @@ def main(arguments): i, usessl=arguments["--use-ssl"], mx=arguments["--mx"], + extra_preloaded_libraries=extra_preloaded_libraries ) if pgbouncer: createPgBouncerConfig(clustername, port, i)