Skip to content

Commit 6757a04

Browse files
committed
arrange citus and tmux targets
so that Makefile.citus is not required for them
1 parent 46225a1 commit 6757a04

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

Makefile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ PGVERSIONS = 11 12 13 14 15 16
99
# Default version:
1010
PGVERSION ?= $(lastword $(PGVERSIONS))
1111

12+
# PostgreSQL cluster option
13+
# could be "--skip-pg-hba"
14+
CLUSTER_OPTS = ""
15+
1216
# XXXX This should be in Makefile.citus only
1317
# but requires to clean up dockerfile and make targets related to citus first.
1418
# Default Citus Data version
@@ -359,6 +363,7 @@ TMUX_EXTRA_COMMANDS ?= ""
359363
TMUX_LAYOUT ?= even-vertical # could be "tiled"
360364
TMUX_TOP_DIR = ./tmux/pgsql
361365
TMUX_SCRIPT = ./tmux/script-$(FIRST_PGPORT).tmux
366+
TMUX_CITUS = ""
362367

363368
# PostgreSQL testing
364369
## total count of Postgres nodes
@@ -369,10 +374,6 @@ NODES_ASYNC ?= 0
369374
NODES_PRIOS ?= 50
370375
## TODO ???
371376
NODES_SYNC_SB ?= -1
372-
## Citus workers (set in Makefile.citus)
373-
WORKERS = 0
374-
## Citus secondaries (set in Makefile.citus)
375-
NODES_SECONDARY = 0
376377

377378
.PHONY: interactive-test
378379
interactive-test:
@@ -388,8 +389,7 @@ $(TMUX_SCRIPT): bin
388389
--async-nodes $(NODES_ASYNC) \
389390
--node-priorities $(NODES_PRIOS) \
390391
--sync-standbys $(NODES_SYNC_SB) \
391-
--citus-workers $(WORKERS) \
392-
--citus-secondaries $(NODES_SECONDARY) \
392+
$(TMUX_CITUS) \
393393
$(CLUSTER_OPTS) \
394394
--binpath $(BINPATH) \
395395
--layout $(TMUX_LAYOUT) > $@
@@ -403,8 +403,7 @@ tmux-clean: bin
403403
--root $(TMUX_TOP_DIR) \
404404
--first-pgport $(FIRST_PGPORT) \
405405
--nodes $(NODES) \
406-
--citus-workers $(WORKERS) \
407-
--citus-secondaries $(NODES_SECONDARY) \
406+
$(TMUX_CITUS) \
408407
$(CLUSTER_OPTS)
409408

410409
.PHONY: tmux-session
@@ -416,8 +415,7 @@ tmux-session: bin
416415
--async-nodes $(NODES_ASYNC) \
417416
--node-priorities $(NODES_PRIOS) \
418417
--sync-standbys $(NODES_SYNC_SB) \
419-
--citus-workers $(WORKERS) \
420-
--citus-secondaries $(NODES_SECONDARY) \
418+
$(TMUX_CITUS) \
421419
$(CLUSTER_OPTS) \
422420
--binpath $(BINPATH) \
423421
--layout $(TMUX_LAYOUT)
@@ -431,8 +429,7 @@ tmux-compose-session:
431429
--async-nodes $(NODES_ASYNC) \
432430
--node-priorities $(NODES_PRIOS) \
433431
--sync-standbys $(NODES_SYNC_SB) \
434-
--citus-workers $(WORKERS) \
435-
--citus-secondaries $(NODES_SECONDARY) \
432+
$(TMUX_CITUS) \
436433
$(CLUSTER_OPTS) \
437434
--binpath $(BINPATH) \
438435
--layout $(TMUX_LAYOUT)

Makefile.citus

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ CITUSTAG ?= v12.1.0
55
CITUS = 0
66
WORKERS = 2
77
NODES_SECONDARY = 0
8-
CLUSTER_OPTS = "" # could be "--skip-pg-hba"
98

109
FIRST_PGPORT ?= 5600
1110
CLUSTER_OPTS += --citus
@@ -22,3 +21,6 @@ ifeq ($(TEST),citus)
2221

2322
TEST_ARGUMENT = --where=tests --tests=$(TESTS_CITUS)
2423
endif
24+
25+
# this target is defined and used later in the main Makefile
26+
$(TMUX_SCRIPT): TMUX_CITUS=--citus-workers $(WORKERS) --citus-secondaries $(NODES_SECONDARY)

0 commit comments

Comments
 (0)