Skip to content

Commit 90fadfc

Browse files
authored
[Disk Manager] fix ydbd pg port collision (#6847)
### Notes When ydbd mon port is selected as 5432 and pg port is set as 5432 there is a port collision. fix it by using port-manager for pgwire port selection by setting YDB_ALLOCATE_PGWIRE_PORT environment variable.
1 parent 864add5 commit 90fadfc

5 files changed

Lines changed: 13 additions & 0 deletions

File tree

cloud/disk_manager/test/recipe/ydb_launcher.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
from cloud.tasks.test.common.processes import register_process, kill_processes
24
from contrib.ydb.tests.library.harness.kikimr_cluster import kikimr_cluster_factory
35
from contrib.ydb.tests.library.harness.kikimr_config import KikimrConfigGenerator
@@ -26,6 +28,9 @@ def __init__(self, ydb_binary_path):
2628
self.__dynamic_storage_pools = dynamic_storage_pools
2729

2830
def start(self):
31+
# Make ydbd use the harness-allocated PGWire port; otherwise its default
32+
# port 5432 may collide with a dynamically allocated monitoring port.
33+
os.environ["YDB_ALLOCATE_PGWIRE_PORT"] = "true"
2934
self.__cluster.start()
3035
for kimimr_node in list(self.__cluster.nodes.values()):
3136
register_process(SERVICE_NAME, kimimr_node.pid)

cloud/tasks/acceptance_tests/ya.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
GO_TEST()
22

3+
ENV(YDB_ALLOCATE_PGWIRE_PORT=true)
4+
35
INCLUDE(${ARCADIA_ROOT}/contrib/ydb/public/tools/ydb_recipe/recipe.inc)
46

57
INCLUDE(${ARCADIA_ROOT}/cloud/tasks/acceptance_tests/recipe/recipe.inc)

cloud/tasks/persistence/tests/ya.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
GO_TEST_FOR(cloud/tasks/persistence)
22

3+
ENV(YDB_ALLOCATE_PGWIRE_PORT=true)
4+
35
INCLUDE(${ARCADIA_ROOT}/contrib/ydb/public/tools/ydb_recipe/recipe.inc)
46

57
SIZE(MEDIUM)

cloud/tasks/storage/tests/ya.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
GO_TEST_FOR(cloud/tasks/storage)
22

3+
ENV(YDB_ALLOCATE_PGWIRE_PORT=true)
4+
35
INCLUDE(${ARCADIA_ROOT}/contrib/ydb/public/tools/ydb_recipe/recipe.inc)
46

57
IF (RACE)

cloud/tasks/tasks_tests/ya.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
GO_TEST()
22

3+
ENV(YDB_ALLOCATE_PGWIRE_PORT=true)
4+
35
INCLUDE(${ARCADIA_ROOT}/contrib/ydb/public/tools/ydb_recipe/recipe.inc)
46

57
GO_XTEST_SRCS(

0 commit comments

Comments
 (0)