Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a4f4249
Feature: Add core support for the Anser extension
leborchuk Sep 3, 2026
4cb8533
Feature: Add the Anser adaptive information sharing extension
leborchuk Sep 3, 2026
f0682a8
Feature: Add Anser regression tests and CI coverage
leborchuk Sep 3, 2026
a7cfff5
Merge branch 'main' into anser-prs
leborchuk Sep 3, 2026
71c8ae4
Fix RAT check gpcontrib/anser
leborchuk Sep 3, 2026
7dd4c04
Rewrite Anser to use existing QD <> QE transport
leborchuk Sep 5, 2026
cda95a5
Fix compile issues after code rewrite
leborchuk Sep 7, 2026
8acfa5b
Do not use frontend PQ api
leborchuk Sep 7, 2026
997ac76
Add debug option to anser
leborchuk Sep 7, 2026
b0870ef
Fix bug that channel canceled stright away, add diagnostic to producer
leborchuk Sep 7, 2026
620190d
More logs to find out what happens on producer site
leborchuk Sep 7, 2026
921cadc
dispatcher drop remaining command on return
leborchuk Sep 7, 2026
f488229
Fix README
leborchuk Sep 11, 2026
a32b84c
Change protocol to uses CRC
leborchuk Sep 11, 2026
3f743cc
Add forgotten files
leborchuk Sep 11, 2026
8c9a01b
Use PG_UINT8_MAX
leborchuk Sep 11, 2026
532deaa
Merge branch 'apache:main' into anser-prs
leborchuk Sep 14, 2026
739d7c0
Fix libpq stream desync when a non-sideband message reaches the QE re…
leborchuk Sep 14, 2026
7af8cc6
Fix binary serialization of CustomScan.methods
leborchuk Sep 14, 2026
195a981
Add support parallel workers
leborchuk Sep 15, 2026
b57320b
Bump catversion for the node string format change in #1823
leborchuk Sep 15, 2026
60e7b41
Sync expected output
Sep 15, 2026
1390ca7
Wake the dispatcher on libpq-buffered input, not just on the socket
leborchuk Sep 16, 2026
c913493
Add debug messages to anser
leborchuk Sep 16, 2026
6ba9da7
Fix build
leborchuk Sep 16, 2026
4638db3
Add description of parallel execution
leborchuk Sep 16, 2026
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