Skip to content

Commit ff6e14a

Browse files
NJrslvtuhaihe
authored andcommitted
[gp_stats_collector] Rename yagp_hooks_collector to gp_stats_collector
Rename extension, shared library, SQL objects, GUC prefix, test files, and all internal identifiers. Restore accidentally deleted files. Clean up stray gmon.out.
1 parent 52b2f53 commit ff6e14a

88 files changed

Lines changed: 2396 additions & 1354 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-cloudberry-rocky8.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ jobs:
320320
"gpcontrib/gp_sparse_vector:installcheck",
321321
"gpcontrib/gp_toolkit:installcheck"]
322322
},
323+
{"test":"gpcontrib-gp-stats-collector",
324+
"make_configs":["gpcontrib/gp_stats_collector:installcheck"],
325+
"extension":"gp_stats_collector"
326+
},
323327
{"test":"ic-fixme",
324328
"make_configs":["src/test/regress:installcheck-fixme"],
325329
"enable_core_check":false
@@ -540,10 +544,11 @@ jobs:
540544
if: needs.check-skip.outputs.should_skip != 'true'
541545
env:
542546
SRC_DIR: ${{ github.workspace }}
547+
CONFIGURE_EXTRA_OPTS: --with-gp-stats-collector
543548
run: |
544549
set -eo pipefail
545550
chmod +x "${SRC_DIR}"/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh
546-
if ! time su - gpadmin -c "cd ${SRC_DIR} && SRC_DIR=${SRC_DIR} ENABLE_DEBUG=${{ env.ENABLE_DEBUG }} ${SRC_DIR}/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh"; then
551+
if ! time su - gpadmin -c "cd ${SRC_DIR} && SRC_DIR=${SRC_DIR} ENABLE_DEBUG=${{ env.ENABLE_DEBUG }} CONFIGURE_EXTRA_OPTS=${{ env.CONFIGURE_EXTRA_OPTS }} ${SRC_DIR}/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh"; then
547552
echo "::error::Configure script failed"
548553
exit 1
549554
fi
@@ -1400,6 +1405,7 @@ jobs:
14001405
if: success() && needs.check-skip.outputs.should_skip != 'true'
14011406
env:
14021407
SRC_DIR: ${{ github.workspace }}
1408+
BUILD_DESTINATION: /usr/local/cloudberry-db
14031409
shell: bash {0}
14041410
run: |
14051411
set -o pipefail
@@ -1423,6 +1429,30 @@ jobs:
14231429
# 2. Follow the same pattern as optimizer
14241430
# 3. Update matrix entries to include the new setting
14251431
1432+
# Create extension if required
1433+
if [[ "${{ matrix.extension != '' }}" == "true" ]]; then
1434+
case "${{ matrix.extension }}" in
1435+
gp_stats_collector)
1436+
if ! su - gpadmin -c "source ${BUILD_DESTINATION}/cloudberry-env.sh && \
1437+
source ${SRC_DIR}/gpAux/gpdemo/gpdemo-env.sh && \
1438+
gpconfig -c shared_preload_libraries -v 'gp_stats_collector' && \
1439+
gpstop -ra && \
1440+
echo 'CREATE EXTENSION IF NOT EXISTS gp_stats_collector; \
1441+
SHOW shared_preload_libraries; \
1442+
TABLE pg_extension;' | \
1443+
psql postgres"
1444+
then
1445+
echo "Error creating gp_stats_collector extension"
1446+
exit 1
1447+
fi
1448+
;;
1449+
*)
1450+
echo "Unknown extension: ${{ matrix.extension }}"
1451+
exit 1
1452+
;;
1453+
esac
1454+
fi
1455+
14261456
# Set PostgreSQL options if defined
14271457
PG_OPTS=""
14281458
if [[ "${{ matrix.pg_settings.optimizer != '' }}" == "true" ]]; then

.github/workflows/build-cloudberry.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ jobs:
271271
},
272272
"enable_core_check":false
273273
},
274-
{"test":"gpcontrib-yagp-hooks-collector",
275-
"make_configs":["gpcontrib/yagp_hooks_collector:installcheck"],
276-
"extension":"yagp_hooks_collector"
274+
{"test":"gpcontrib-gp-stats-collector",
275+
"make_configs":["gpcontrib/gp_stats_collector:installcheck"],
276+
"extension":"gp_stats_collector"
277277
},
278278
{"test":"ic-expandshrink",
279279
"make_configs":["src/test/isolation2:installcheck-expandshrink"]
@@ -539,7 +539,7 @@ jobs:
539539
if: needs.check-skip.outputs.should_skip != 'true'
540540
env:
541541
SRC_DIR: ${{ github.workspace }}
542-
CONFIGURE_EXTRA_OPTS: --with-yagp-hooks-collector
542+
CONFIGURE_EXTRA_OPTS: --with-gp-stats-collector
543543
run: |
544544
set -eo pipefail
545545
chmod +x "${SRC_DIR}"/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh
@@ -1441,17 +1441,17 @@ jobs:
14411441
# Create extension if required
14421442
if [[ "${{ matrix.extension != '' }}" == "true" ]]; then
14431443
case "${{ matrix.extension }}" in
1444-
yagp_hooks_collector)
1444+
gp_stats_collector)
14451445
if ! su - gpadmin -c "source ${BUILD_DESTINATION}/cloudberry-env.sh && \
14461446
source ${SRC_DIR}/gpAux/gpdemo/gpdemo-env.sh && \
1447-
gpconfig -c shared_preload_libraries -v 'yagp_hooks_collector' && \
1447+
gpconfig -c shared_preload_libraries -v 'gp_stats_collector' && \
14481448
gpstop -ra && \
1449-
echo 'CREATE EXTENSION IF NOT EXISTS yagp_hooks_collector; \
1449+
echo 'CREATE EXTENSION IF NOT EXISTS gp_stats_collector; \
14501450
SHOW shared_preload_libraries; \
14511451
TABLE pg_extension;' | \
14521452
psql postgres"
14531453
then
1454-
echo "Error creating yagp_hooks_collector extension"
1454+
echo "Error creating gp_stats_collector extension"
14551455
exit 1
14561456
fi
14571457
;;

.github/workflows/build-deb-cloudberry.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ jobs:
252252
"gpcontrib/gp_sparse_vector:installcheck",
253253
"gpcontrib/gp_toolkit:installcheck"]
254254
},
255+
{"test":"gpcontrib-gp-stats-collector",
256+
"make_configs":["gpcontrib/gp_stats_collector:installcheck"],
257+
"extension":"gp_stats_collector"
258+
},
255259
{"test":"ic-cbdb-parallel",
256260
"make_configs":["src/test/regress:installcheck-cbdb-parallel"]
257261
}
@@ -448,13 +452,14 @@ jobs:
448452
shell: bash
449453
env:
450454
SRC_DIR: ${{ github.workspace }}
455+
CONFIGURE_EXTRA_OPTS: --with-gp-stats-collector
451456
run: |
452457
set -eo pipefail
453458
454459
export BUILD_DESTINATION=${SRC_DIR}/debian/build
455460
456461
chmod +x "${SRC_DIR}"/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh
457-
if ! time su - gpadmin -c "cd ${SRC_DIR} && SRC_DIR=${SRC_DIR} ENABLE_DEBUG=${{ env.ENABLE_DEBUG }} BUILD_DESTINATION=${BUILD_DESTINATION} ${SRC_DIR}/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh"; then
462+
if ! time su - gpadmin -c "cd ${SRC_DIR} && SRC_DIR=${SRC_DIR} ENABLE_DEBUG=${{ env.ENABLE_DEBUG }} CONFIGURE_EXTRA_OPTS=${{ env.CONFIGURE_EXTRA_OPTS }} BUILD_DESTINATION=${BUILD_DESTINATION} ${SRC_DIR}/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh"; then
458463
echo "::error::Configure script failed"
459464
exit 1
460465
fi
@@ -1341,6 +1346,7 @@ jobs:
13411346
if: success() && needs.check-skip.outputs.should_skip != 'true'
13421347
env:
13431348
SRC_DIR: ${{ github.workspace }}
1349+
BUILD_DESTINATION: ${{ github.workspace }}/debian/build
13441350
shell: bash {0}
13451351
run: |
13461352
set -o pipefail
@@ -1365,6 +1371,30 @@ jobs:
13651371
# 3. Update matrix entries to include the new setting
13661372
13671373
1374+
# Create extension if required
1375+
if [[ "${{ matrix.extension != '' }}" == "true" ]]; then
1376+
case "${{ matrix.extension }}" in
1377+
gp_stats_collector)
1378+
if ! su - gpadmin -c "source ${BUILD_DESTINATION}/cloudberry-env.sh && \
1379+
source ${SRC_DIR}/gpAux/gpdemo/gpdemo-env.sh && \
1380+
gpconfig -c shared_preload_libraries -v 'gp_stats_collector' && \
1381+
gpstop -ra && \
1382+
echo 'CREATE EXTENSION IF NOT EXISTS gp_stats_collector; \
1383+
SHOW shared_preload_libraries; \
1384+
TABLE pg_extension;' | \
1385+
psql postgres"
1386+
then
1387+
echo "Error creating gp_stats_collector extension"
1388+
exit 1
1389+
fi
1390+
;;
1391+
*)
1392+
echo "Unknown extension: ${{ matrix.extension }}"
1393+
exit 1
1394+
;;
1395+
esac
1396+
fi
1397+
13681398
# Set PostgreSQL options if defined
13691399
PG_OPTS=""
13701400
if [[ "${{ matrix.pg_settings.optimizer != '' }}" == "true" ]]; then

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,3 @@ lib*.pc
7474
/tmp_install/
7575
/.cache/
7676
/install/
77-
*.o
78-
*.so
79-
src/protos/
80-
.vscode
81-
compile_commands.json

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
# to build Postgres with a different make, we have this make file
44
# that, as a service, will look for a GNU make and invoke it, or show
55
# an error message if none could be found.
6+
67
# If the user were using GNU make now, this file would not get used
78
# because GNU make uses a make file named "GNUmakefile" in preference
89
# to "Makefile" if it exists. PostgreSQL is shipped with a
910
# "GNUmakefile". If the user hasn't run the configure script yet, the
1011
# GNUmakefile won't exist yet, so we catch that case as well.
1112

13+
1214
# AIX make defaults to building *every* target of the first rule. Start with
1315
# a single-target, empty rule to make the other targets non-default.
1416
all:

configure

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ with_apr_config
722722
with_libcurl
723723
with_rt
724724
with_zstd
725-
with_yagp_hooks_collector
725+
with_gp_stats_collector
726726
with_libbz2
727727
LZ4_LIBS
728728
LZ4_CFLAGS
@@ -943,7 +943,7 @@ with_zlib
943943
with_lz4
944944
with_libbz2
945945
with_zstd
946-
with_yagp_hooks_collector
946+
with_gp_stats_collector
947947
with_rt
948948
with_libcurl
949949
with_apr_config
@@ -11153,14 +11153,14 @@ fi
1115311153
fi
1115411154

1115511155
#
11156-
# yagp_hooks_collector
11156+
# gp_stats_collector
1115711157
#
1115811158

1115911159

1116011160

11161-
# Check whether --with-yagp-hooks-collector was given.
11162-
if test "${with_yagp_hooks_collector+set}" = set; then :
11163-
withval=$with_yagp_hooks_collector;
11161+
# Check whether --with-gp-stats-collector was given.
11162+
if test "${with_gp_stats_collector+set}" = set; then :
11163+
withval=$with_gp_stats_collector;
1116411164
case $withval in
1116511165
yes)
1116611166
:
@@ -11169,12 +11169,12 @@ if test "${with_yagp_hooks_collector+set}" = set; then :
1116911169
:
1117011170
;;
1117111171
*)
11172-
as_fn_error $? "no argument expected for --with-yagp-hooks-collector option" "$LINENO" 5
11172+
as_fn_error $? "no argument expected for --with-gp-stats-collector option" "$LINENO" 5
1117311173
;;
1117411174
esac
1117511175

1117611176
else
11177-
with_yagp_hooks_collector=no
11177+
with_gp_stats_collector=no
1117811178

1117911179
fi
1118011180

configure.ac

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,11 +1366,22 @@ AC_MSG_RESULT([$with_zstd])
13661366
AC_SUBST(with_zstd)
13671367

13681368
#
1369-
# yagp_hooks_collector
1369+
# gp_stats_collector
13701370
#
1371-
PGAC_ARG_BOOL(with, yagp_hooks_collector, no,
1372-
[build with YAGP hooks collector extension])
1373-
AC_SUBST(with_yagp_hooks_collector)
1371+
PGAC_ARG_BOOL(with, gp_stats_collector, no,
1372+
[build with stats collector extension])
1373+
AC_SUBST(with_gp_stats_collector)
1374+
1375+
if test "$with_gp_stats_collector" = yes; then
1376+
PKG_CHECK_MODULES([PROTOBUF], [protobuf >= 3.0.0],
1377+
[],
1378+
[AC_MSG_ERROR([protobuf >= 3.0.0 is required for gp_stats_collector])]
1379+
)
1380+
AC_PATH_PROG([PROTOC], [protoc], [no])
1381+
if test "$PROTOC" = no; then
1382+
AC_MSG_ERROR([protoc is required for gp_stats_collector but was not found in PATH])
1383+
fi
1384+
fi
13741385

13751386
if test "$with_zstd" = yes; then
13761387
dnl zstd_errors.h was renamed from error_public.h in v1.4.0

gpcontrib/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ else
3535
diskquota
3636
endif
3737

38-
ifeq "$(with_yagp_hooks_collector)" "yes"
39-
recurse_targets += yagp_hooks_collector
38+
ifeq "$(with_gp_stats_collector)" "yes"
39+
recurse_targets += gp_stats_collector
4040
endif
4141
ifeq "$(with_zstd)" "yes"
4242
recurse_targets += zstd
File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.o
2+
*.so
3+
src/protos/
4+
.vscode
5+
compile_commands.json

0 commit comments

Comments
 (0)