Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/build-cloudberry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ jobs:
"make_configs":["src/test/regress:installcheck-good"],
"pg_settings":{"optimizer":"on"}
},
{"test":"ic-anser",
"make_configs":["gpcontrib/anser:installcheck-with-install"],
"shared_preload_libraries":"anser",
"postgres_conf_addons":"anser.enable=on"
},
{"test":"pax-ic-good-opt-off",
"make_configs":[
"contrib/pax_storage/:pax-test",
Expand Down Expand Up @@ -1505,6 +1510,15 @@ jobs:
echo "Adding shared_preload_libraries: ${{ matrix.shared_preload_libraries }}"
fi

# Append extra postgresql.conf settings requested by the matrix
# entry (e.g. postmaster-context GUCs a test module requires).
# BLDWRAP_POSTGRES_CONF_ADDONS is a pipe-separated list of
# key=value pairs (see gpAux/gpdemo/demo_cluster.sh).
if [[ -n "${{ matrix.postgres_conf_addons }}" ]]; then
EXTRA_CONF="${EXTRA_CONF}${EXTRA_CONF:+|}${{ matrix.postgres_conf_addons }}"
echo "Adding postgres_conf_addons: ${{ matrix.postgres_conf_addons }}"
fi

if ! time su - gpadmin -c "cd ${SRC_DIR} && NUM_PRIMARY_MIRROR_PAIRS='${{ matrix.num_primary_mirror_pairs }}' BLDWRAP_POSTGRES_CONF_ADDONS=\"${EXTRA_CONF}\" SRC_DIR=${SRC_DIR} ${SRC_DIR}/devops/build/automation/cloudberry/scripts/create-cloudberry-demo-cluster.sh"; then
echo "::error::Demo cluster creation failed"
exit 1
Expand Down
6 changes: 4 additions & 2 deletions gpcontrib/Makefile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any possibility to add a new configuration option, such as --enable-anser?

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ recurse_targets = ""
recurse_targets = gp_exttable_fdw

ifeq "$(enable_debug_extensions)" "yes"
recurse_targets = gp_sparse_vector \
recurse_targets = anser \
gp_sparse_vector \
gp_distribution_policy \
gp_internal_tools \
gp_debug_numsegments \
Expand All @@ -29,7 +30,8 @@ ifeq "$(enable_debug_extensions)" "yes"
pg_hint_plan \
reject_partition_fullscan
else
recurse_targets = gp_sparse_vector \
recurse_targets = anser \
gp_sparse_vector \
gp_distribution_policy \
gp_internal_tools \
gp_legacy_string_agg \
Expand Down
103 changes: 103 additions & 0 deletions gpcontrib/anser/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#-------------------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Makefile for the anser extension.
#
# IDENTIFICATION
# gpcontrib/anser/Makefile
#
#-------------------------------------------------------------------------

MODULE_big = anser
OBJS = \
$(WIN32RES) \
src/anserbloomconsume.o \
src/anserbloomproduce.o \
src/anserdispatch.o \
src/anserfilter.o \
src/anserinit.o \
src/anserpayload.o \
src/anserplan.o \
src/anserplanexec.o \
src/ansersideband.o \
src/anser_test.o

PGFILEDESC = "anser - adaptive information sharing runtime filters"

# The subsystem itself needs no catalog objects -- it is configured entirely by
# GUCs and travels over the dispatch connection. The only extension here is
# anser_test, which exposes the internal C API to the regression tests from
# inside the same library.
EXTENSION = anser_test
DATA = anser_test--1.0.sql

REGRESS = anser_test anser_runtime_filter

# src/anserdispatch.c writes sideband messages onto the dispatcher's own libpq
# connections, so it needs libpq's internal headers (as the dispatcher itself
# does). Deliberately NOT linked against libpq: the pq* writers we use stay
# global in the postgres binary, while the public PQ* API is made local there
# on purpose (src/backend/Makefile), so linking libpq.so would put a second
# copy of libpq on connections the backend's copy created.
PG_CPPFLAGS = -I$(srcdir)/include -I$(libpq_srcdir)
SHLIB_PREREQS = submake-libpq

ifdef USE_PGXS
PG_CONFIG ?= pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = gpcontrib/anser
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif

# The tests need the live gather/send services, which only exist when the
# library is preloaded and anser.enable is on -- both postmaster-context
# settings. Ensure them (and restart) before installcheck, as
# gp_relsizes_stats does for its worker.
installcheck: preload-anser

.PHONY: preload-anser
preload-anser:
@if [ -z "$$COORDINATOR_DATA_DIRECTORY$$MASTER_DATA_DIRECTORY" ]; then \
echo "ERROR: COORDINATOR_DATA_DIRECTORY (or MASTER_DATA_DIRECTORY) is not set;" >&2; \
echo " source cloudberry-env.sh and gpdemo-env.sh before running installcheck." >&2; \
exit 1; \
fi
@current=`psql -d postgres -At -c "SHOW shared_preload_libraries;" | tr -d ' '`; \
case ",$$current," in \
*,anser,*) \
echo "==> shared_preload_libraries already contains anser" ;; \
*) \
if [ -z "$$current" ]; then new=anser; else new="$$current,anser"; fi; \
echo "==> Adding anser to shared_preload_libraries ($$new)"; \
gpconfig -c shared_preload_libraries -v "'$$new'" --skipvalidation ;; \
esac
gpconfig -c anser.enable -v on --skipvalidation
gpstop -ra
psql -d postgres -c "SHOW shared_preload_libraries;"

# CI runs a single make target per test config, so offer one target that
# installs the extension, arms the cluster, and runs the tests.
.PHONY: installcheck-with-install
installcheck-with-install:
$(MAKE) install
$(MAKE) installcheck
Loading
Loading