diff --git a/src/bin/gs_guc/cluster_guc.conf b/src/bin/gs_guc/cluster_guc.conf index efaff2028..a4caf2779 100755 --- a/src/bin/gs_guc/cluster_guc.conf +++ b/src/bin/gs_guc/cluster_guc.conf @@ -713,6 +713,8 @@ ss_instance_id|int|0,63|NULL|NULL| ss_interconnect_url|string|0,0|NULL|NULL| ss_rdma_work_config|string|0,0|NULL|NULL| ss_ock_log_path|string|0,0|NULL|NULL| +dolphin_server_port|int|1024,65535|NULL|NULL| +enable_dolphin_proto|bool|0,0|NULL|NULL| [cmserver] log_dir|string|0,0|NULL|NULL| log_file_size|int|0,2047|MB|NULL| diff --git a/src/common/backend/utils/misc/guc/guc_network.cpp b/src/common/backend/utils/misc/guc/guc_network.cpp index 1fbf88fc5..9a8061e04 100755 --- a/src/common/backend/utils/misc/guc/guc_network.cpp +++ b/src/common/backend/utils/misc/guc/guc_network.cpp @@ -347,6 +347,17 @@ static void InitNetworkConfigureNamesBool() check_ssl, NULL, NULL}, + {{"enable_dolphin_proto", + PGC_POSTMASTER, + NODE_ALL, + CONN_AUTH_SECURITY, + gettext_noop("Enables dolphin database protocol"), + NULL}, + &g_instance.attr.attr_network.enable_dolphin_proto, + false, + NULL, + NULL, + NULL}, /* End-of-list marker */ {{NULL, @@ -855,6 +866,19 @@ static void InitNetworkConfigureNamesInt() NULL, NULL, NULL}, + {{"dolphin_server_port", + PGC_POSTMASTER, + NODE_ALL, + CONN_AUTH_SETTINGS, + gettext_noop("Sets the TCP port the server listens on for dolphin client-server protocol."), + NULL}, + &g_instance.attr.attr_network.dolphin_server_port, + 3308, + 1024, + 65535, + NULL, + NULL, + NULL}, /* End-of-list marker */ {{NULL, (GucContext)0, diff --git a/src/include/knl/knl_guc/knl_instance_attr_network.h b/src/include/knl/knl_guc/knl_instance_attr_network.h index 429f666e3..a5194b884 100644 --- a/src/include/knl/knl_guc/knl_instance_attr_network.h +++ b/src/include/knl/knl_guc/knl_instance_attr_network.h @@ -73,6 +73,8 @@ typedef struct knl_instance_attr_network { SSL_CTX* SSL_server_context; GS_UCHAR* server_key; #endif + bool enable_dolphin_proto; + int dolphin_server_port; } knl_instance_attr_network; #endif /* SRC_INCLUDE_KNL_KNL_INSTANCE_ATTR_NETWORK_H_ */ diff --git a/src/test/regress/input/dolphin_guc_config.source b/src/test/regress/input/dolphin_guc_config.source new file mode 100644 index 000000000..2f6350a4d --- /dev/null +++ b/src/test/regress/input/dolphin_guc_config.source @@ -0,0 +1,11 @@ +show dolphin_server_port; +show enable_dolphin_proto; + +\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_dolphin_proto=on" > /dev/null 2>&1 +\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "dolphin_server_port=3310" > /dev/null 2>&1 +\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/datanode1 > /dev/null 2>&1 +\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/datanode1 > /dev/null 2>&1 +\! sleep 5 + +\! @abs_bindir@/gsql -r -p @portstring@ -d postgres -c "show dolphin_server_port"; +\! @abs_bindir@/gsql -r -p @portstring@ -d postgres -c "show enable_dolphin_proto"; diff --git a/src/test/regress/output/dolphin_guc_config.source b/src/test/regress/output/dolphin_guc_config.source new file mode 100644 index 000000000..911f66c8b --- /dev/null +++ b/src/test/regress/output/dolphin_guc_config.source @@ -0,0 +1,29 @@ +show dolphin_server_port; + dolphin_server_port +--------------------- + 3308 +(1 row) + +show enable_dolphin_proto; + enable_dolphin_proto +---------------------- + off +(1 row) + +\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_dolphin_proto=on" > /dev/null 2>&1 +\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "dolphin_server_port=3310" > /dev/null 2>&1 +\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/datanode1 > /dev/null 2>&1 +\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/datanode1 > /dev/null 2>&1 +\! sleep 5 +\! @abs_bindir@/gsql -r -p @portstring@ -d postgres -c "show dolphin_server_port"; + dolphin_server_port +--------------------- + 3310 +(1 row) + +\! @abs_bindir@/gsql -r -p @portstring@ -d postgres -c "show enable_dolphin_proto"; + enable_dolphin_proto +---------------------- + on +(1 row) + diff --git a/src/test/regress/output/recovery_2pc_tools.source b/src/test/regress/output/recovery_2pc_tools.source index 9943b0c85..298633bf5 100644 --- a/src/test/regress/output/recovery_2pc_tools.source +++ b/src/test/regress/output/recovery_2pc_tools.source @@ -202,6 +202,7 @@ select name,vartype,unit,min_val,max_val from pg_settings where name <> 'qunit_c dfs_partition_directory_length | integer | | 92 | 7999 dirty_page_percent_max | real | | 0.1 | 1 disable_memory_protect | bool | | | + dolphin_server_port | integer | | 1024 | 65535 dw_file_num | integer | | 1 | 16 dw_file_size | integer | | 32 | 256 dynamic_library_path | string | | | @@ -243,6 +244,7 @@ select name,vartype,unit,min_val,max_val from pg_settings where name <> 'qunit_c enable_default_ustore_table | bool | | | enable_defer_calculate_snapshot | bool | | | enable_delta_store | bool | | | + enable_dolphin_proto | bool | | | enable_double_write | bool | | | enable_early_free | bool | | | enable_extrapolation_stats | bool | | | diff --git a/src/test/regress/parallel_schedule0 b/src/test/regress/parallel_schedule0 index 96641c37a..71d28617a 100644 --- a/src/test/regress/parallel_schedule0 +++ b/src/test/regress/parallel_schedule0 @@ -1012,3 +1012,6 @@ test: rename_table # debug instrument test: test_debug5 + +# dolphin_guc_config +test: dolphin_guc_config