Skip to content
Open
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 @@ -1533,6 +1538,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
32 changes: 32 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,7 @@ GCOV
enable_debug
enable_orafce
enable_faultinjector
with_anser
enable_debug_extensions
enable_pxf
enable_gpfdist
Expand Down Expand Up @@ -892,6 +893,7 @@ enable_strong_random
enable_gpfdist
enable_pxf
enable_debug_extensions
with_anser
enable_faultinjector
enable_orafce
enable_debug
Expand Down Expand Up @@ -1663,6 +1665,7 @@ Optional Packages:
--with-libraries=DIRS look for additional libraries in DIRS
--with-libs=DIRS alternative spelling of --with-libraries
--with-pgport=PORTNUM set default port number [5432]
--with-anser build the Anser runtime-filter extension
--with-blocksize=BLOCKSIZE
set table block size in kB [8]
--with-segsize=SEGSIZE set table segment size in GB [1]
Expand Down Expand Up @@ -3631,6 +3634,35 @@ fi



#
# Anser adaptive information sharing (runtime filters)
#



# Check whether --with-anser was given.
if test "${with_anser+set}" = set; then :
withval=$with_anser;
case $withval in
yes)
:
;;
no)
:
;;
*)
as_fn_error $? "no argument expected for --with-anser option" "$LINENO" 5
;;
esac

else
with_anser=no

fi




#
# Enable fault injector
#
Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ PGAC_ARG_BOOL(enable, debug-extensions, yes,
[exclude debug extensions in gpcontrib])
AC_SUBST(enable_debug_extensions)

#
# Anser adaptive information sharing (runtime filters)
#
PGAC_ARG_BOOL(with, anser, no,
[build the Anser runtime-filter extension])
AC_SUBST(with_anser)

Comment thread
leborchuk marked this conversation as resolved.
#
# Enable fault injector
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
# - MapReduce Processing
# - Oracle Compatibility (orafce)
# - ORCA Query Optimizer
# - Anser Runtime Filters
# - PAX Access Method
# - PXF External Table Access
# - Test Automation Support (tap-tests)
Expand Down Expand Up @@ -162,6 +163,7 @@ execute_cmd ./configure --prefix=${BUILD_DESTINATION} \
--disable-pxf \
--enable-tap-tests \
${CONFIGURE_DEBUG_OPTS} \
--with-anser \
--with-diskquota \
--with-gp-stats-collector \
--with-gssapi \
Expand Down
7 changes: 7 additions & 0 deletions gpcontrib/Makefile
Comment thread
leborchuk marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ endif
ifeq "$(with_gp_stats_collector)" "yes"
recurse_targets += gp_stats_collector
endif

# Anser is opt-in at configure time: --with-anser (off by default).
ifeq "$(with_anser)" "yes"
recurse_targets += anser
endif

$(call recurse,all install clean distclean, $(recurse_targets))

all: gpcloud pxf mapreduce orafce
Expand Down Expand Up @@ -113,3 +119,4 @@ installcheck:
$(MAKE) -C gp_toolkit installcheck
$(MAKE) -C gp_exttable_fdw installcheck
if [ "$(with_diskquota)" = "yes" ]; then $(MAKE) -C diskquota installcheck; fi
if [ "$(with_anser)" = "yes" ]; then $(MAKE) -C anser installcheck; fi
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 anser_multijoin

# 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