Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6b10f42
Check for CREATE privilege on the schema in CREATE STATISTICS.
nathan-bossart Nov 10, 2025
28538ac
libpq: Prevent some overflows of int/size_t
jchampio Nov 10, 2025
1242328
Adapt CBDB regression test suite for 07ffe0783
reshke May 31, 2026
3e8dacc
pgcrypto: Fix buffer overflow in pgp_pub_decrypt_bytea()
michaelpq Feb 8, 2026
31053ae
Fix encoding length for EUC_CN.
macdice Feb 4, 2026
0ead711
Fix mb2wchar functions on short input.
macdice Jan 25, 2026
b70a1ec
Replace pg_mblen() with bounds-checked versions.
macdice Jan 7, 2026
0b4f402
Code coverage for most pg_mblen* calls.
macdice Jan 11, 2026
d6749e2
Require PGP-decrypted text to pass encoding validation.
nmisch Feb 9, 2026
beddb69
Guard against unexpected dimensions of oidvector/int2vector.
tglsfdc Feb 9, 2026
d6b9534
Add a syscache on pg_extension.oid.
tglsfdc Feb 9, 2026
30d1523
Require superuser to install a non-built-in selectivity estimator.
tglsfdc Feb 9, 2026
d4d3cf5
Harden _int_matchsel() against being attached to the wrong operator.
tglsfdc Feb 9, 2026
87cefe0
Rebase fixes & RAT check fix
reshke May 31, 2026
1854534
macOS: make PAX's liburing dependency optional
avamingli May 28, 2026
4f58444
macOS: provide HZ fallback for UDP interconnect
avamingli May 28, 2026
8fa1a42
Drop -Werror -Wextra -Wpedantic from ORCA C++ build
avamingli May 28, 2026
d107ea4
macOS: defer libpostgres.so's undefined symbols to load time
avamingli May 28, 2026
a2e512e
macOS: PAX cmake portability
avamingli May 28, 2026
273b9a2
macOS: PAX C++ portability
avamingli May 28, 2026
3917609
macOS: build the standalone libpaxformat reader
avamingli May 28, 2026
e4bf9da
numeric: drop bogus 'const' qualifier on init_var_from_str
avamingli May 28, 2026
de0e7a5
macOS: pin DLSUFFIX=.so for PG 16 compatibility
avamingli May 28, 2026
e86bac6
macOS: demote clang-strict warning categories in Makefile.custom
avamingli May 29, 2026
344bac8
ic_udpifc: fix initSndBufferPool forward declaration
avamingli May 29, 2026
104f37b
Fix for CDBD expand with concurrent distributed tx (#1803)
reshke Jun 4, 2026
5651950
Enable ic-resgroup-v2 in pipeline
chenjinbao1989 May 31, 2026
392978a
Support distribution key update in MERGE for partitioned tables
lss602726449 May 11, 2026
f5dd3b2
Enable pg_depend corruption defense tests in create_view
lss602726449 May 22, 2026
43f4903
Enable ORCA runtime filter pushdown tests in gp_runtime_filter
lss602726449 May 22, 2026
cd5e5a4
Restore register_dirty_segment for fsync safety and fix AO fsync crash
lss602726449 Jun 1, 2026
43c3c26
Fix pg_stat_activity sess_id not updated after gang reset
lss602726449 Jun 1, 2026
c781604
Fix vacuum_progress_column/row flaky tests by ensuring FTS detects mi…
lss602726449 Jun 2, 2026
e354e98
PAX/toast: aux's TOAST goes to pg_toast, aux itself clamped to PERMANENT
gfphoenix78 Jun 3, 2026
e5e92ae
Fix security checks in selectivity estimation functions.
deanrasheed Aug 11, 2025
c11d8da
Convert newlines to spaces in names written in v11+ pg_dump comments.
nmisch Aug 11, 2025
b70df45
Restrict psql meta-commands in plain-text dumps.
nathan-bossart Aug 11, 2025
3a64dbc
Adapt cloudberry regression suite for regression changes
reshke Jun 6, 2026
9fb2426
Feature: add reject_partition_fullscan extension (#1713)
lqriu Jun 18, 2026
fdbd304
Add interconnect regression tests
MutableFire Jun 2, 2026
e0c9a35
Merge branch 'main' into gp_interconnect_stats
MutableFire Jun 18, 2026
7c5dc20
non-tech FIX
MutableFire Jun 19, 2026
ce5672d
Merge branch 'gp_interconnect_stats' of https://github.com/MutableFir…
MutableFire Jun 19, 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
3 changes: 1 addition & 2 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ github:
- pax-ic-isolation2-opt-on
- ic-expandshrink
- ic-singlenode
# MERGE16_FIXME: enable it later
# - ic-resgroup-v2
- ic-resgroup-v2
- ic-contrib
- ic-gpcontrib
- ic-fixme
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-cloudberry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ jobs:
"contrib/formatter_fixedwidth:installcheck",
"contrib/hstore:installcheck",
"contrib/indexscan:installcheck",
"contrib/interconnect:installcheck",
"contrib/pg_trgm:installcheck",
"contrib/indexscan:installcheck",
"contrib/pgcrypto:installcheck",
Expand Down
32 changes: 26 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -9891,7 +9891,16 @@ _ACEOF
LIBS="-luring $LIBS"

else
as_fn_error $? "library 'uring' is required for PAX support" "$LINENO" 5
# liburing is required on Linux (io_uring is a Linux 5.1+ kernel iface);
# on non-Linux hosts PAX falls back to pread-based SyncFastIO.
case $host_os in
linux*)
as_fn_error $? "library 'uring' is required for PAX support on Linux" "$LINENO" 5
;;
*)
:
;;
esac
fi


Expand Down Expand Up @@ -12968,13 +12977,24 @@ else
fi
# Search for a likely-looking file.
found_shlib=0
# On Darwin, Python ships its shared lib as .dylib regardless of
# what DLSUFFIX is set to for modules. Try .dylib in addition to
# the configured DLSUFFIX so this check still finds libpython.
if test "$PORTNAME" = darwin; then
python_shlib_suffixes="$DLSUFFIX .dylib"
else
python_shlib_suffixes="$DLSUFFIX"
fi
for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
do
if test -e "$d/lib${ldlibrary}${DLSUFFIX}"; then
python_libdir="$d"
found_shlib=1
break 2
fi
for s in $python_shlib_suffixes
do
if test -e "$d/lib${ldlibrary}${s}"; then
python_libdir="$d"
found_shlib=1
break 3
fi
done
done
# Some platforms (OpenBSD) require us to accept a bare versioned shlib
# (".so.n.n") as well. However, check this only after failing to find
Expand Down
16 changes: 13 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1035,9 +1035,19 @@ if test "$enable_pax" = yes; then
[AC_MSG_ERROR([libzstd >= 1.4.0 is required for PAX support])]
)

# Check liburing
AC_CHECK_LIB(uring, io_uring_queue_init, [],
[AC_MSG_ERROR([library 'uring' is required for PAX support])])
# Check liburing. liburing is Linux-only (io_uring kernel iface, 5.1+).
# On Linux it is required as before; on non-Linux hosts (macOS / *BSD)
# PAX falls back to pread-based SyncFastIO and the IOUringFastIO path
# is conditionally compiled — see contrib/pax_storage/src/cpp/comm/fast_io.*
case $host_os in
linux*)
AC_CHECK_LIB(uring, io_uring_queue_init, [],
[AC_MSG_ERROR([library 'uring' is required for PAX support on Linux])])
;;
*)
AC_CHECK_LIB(uring, io_uring_queue_init, [], [])
;;
esac

# Check cmake >= 3.11.0 using AX_COMPARE_VERSION
AC_PATH_PROG([CMAKE], [cmake], [no])
Expand Down
21 changes: 16 additions & 5 deletions contrib/btree_gist/btree_utils_var.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,36 +116,47 @@ gbt_var_leaf2node(GBT_VARKEY *leaf, const gbtree_vinfo *tinfo, FmgrInfo *flinfo)

/*
* returns the common prefix length of a node key
*
* If the underlying type is character data, the prefix length may point in
* the middle of a multibyte character.
*/
static int32
gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)
{
GBT_VARKEY_R r = gbt_var_key_readable(node);
int32 i = 0;
int32 l = 0;
int32 l_left_to_match = 0;
int32 l_total = 0;
int32 t1len = VARSIZE(r.lower) - VARHDRSZ;
int32 t2len = VARSIZE(r.upper) - VARHDRSZ;
int32 ml = Min(t1len, t2len);
char *p1 = VARDATA(r.lower);
char *p2 = VARDATA(r.upper);
const char *end1 = p1 + t1len;
const char *end2 = p2 + t2len;

if (ml == 0)
return 0;

while (i < ml)
{
if (tinfo->eml > 1 && l == 0)
if (tinfo->eml > 1 && l_left_to_match == 0)
{
if ((l = pg_mblen(p1)) != pg_mblen(p2))
l_total = pg_mblen_range(p1, end1);
if (l_total != pg_mblen_range(p2, end2))
{
return i;
}
l_left_to_match = l_total;
}
if (*p1 != *p2)
{
if (tinfo->eml > 1)
{
return (i - l + 1);
int32 l_matched_subset = l_total - l_left_to_match;

/* end common prefix at final byte of last matching char */
return i - l_matched_subset;
}
else
{
Expand All @@ -155,7 +166,7 @@ gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)

p1++;
p2++;
l--;
l_left_to_match--;
i++;
}
return ml; /* lower == upper */
Expand Down
8 changes: 4 additions & 4 deletions contrib/dict_xsyn/dict_xsyn.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ find_word(char *in, char **end)
char *start;

*end = NULL;
while (*in && t_isspace(in))
in += pg_mblen(in);
while (*in && t_isspace_cstr(in))
in += pg_mblen_cstr(in);

if (!*in || *in == '#')
return NULL;
start = in;

while (*in && !t_isspace(in))
in += pg_mblen(in);
while (*in && !t_isspace_cstr(in))
in += pg_mblen_cstr(in);

*end = in;

Expand Down
2 changes: 1 addition & 1 deletion contrib/hstore/hstore_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ prssyntaxerror(HSParser *state)
errsave(state->escontext,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("syntax error in hstore, near \"%.*s\" at position %d",
pg_mblen(state->ptr), state->ptr,
pg_mblen_cstr(state->ptr), state->ptr,
(int) (state->ptr - state->begin))));
/* In soft error situation, return false as convenience for caller */
return false;
Expand Down
14 changes: 13 additions & 1 deletion contrib/intarray/_int_selfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "catalog/pg_operator.h"
#include "catalog/pg_statistic.h"
#include "catalog/pg_type.h"
#include "commands/extension.h"
#include "miscadmin.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
Expand Down Expand Up @@ -171,7 +172,18 @@ _int_matchsel(PG_FUNCTION_ARGS)
PG_RETURN_FLOAT8(0.0);
}

/* The caller made sure the const is a query, so get it now */
/*
* Verify that the Const is a query_int, else return a default estimate.
* (This could only fail if someone attached this estimator to the wrong
* operator.)
*/
if (((Const *) other)->consttype !=
get_function_sibling_type(fcinfo->flinfo->fn_oid, "query_int"))
{
ReleaseVariableStats(vardata);
PG_RETURN_FLOAT8(DEFAULT_EQ_SEL);
}

query = DatumGetQueryTypeP(((Const *) other)->constvalue);

/* Empty query matches nothing */
Expand Down
6 changes: 6 additions & 0 deletions contrib/interconnect/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ include $(top_builddir)/contrib/interconnect/Makefile.interconnect
MODULE_big = interconnect
PGFILEDESC = "interconnect - inter connection module"

EXTENSION = interconnect
EXTENSION_VERSION = 1.0
DATA = interconnect--$(EXTENSION_VERSION).sql

OBJS = \
$(WIN32RES) \
ic_common.o \
Expand All @@ -33,6 +37,8 @@ OBJS += proxy/ic_proxy_iobuf.o
SHLIB_LINK += $(filter -luv, $(LIBS))
endif # enable_ic_proxy

REGRESS = interconnect

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
Expand Down
32 changes: 32 additions & 0 deletions contrib/interconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,35 @@ udpifc result:

Notice that: Lower TPS does not mean the protocol is slower, might means that the cpu time taken by the protocol is low. For the udpifc, it satisfies the highest tps required by `cbdb`. at the same time it occupies a lower cpu than other types of interconnect.

# interconnect statistics

This extension provides cumulative interconnect statistics for Apache Cloudberry, including queue sizes, buffer usage, retransmits, packet errors, and other UDPIFC‑related metrics.

It exposes three views with statistics at different aggregation levels:
- gp_interconnect_stats — total cluster‑wide stats;
- gp_interconnect_stats_per_segment — stats per segment;
- gp_interconnect_stats_per_host — stats grouped by host.

## How to create the extension

Add interconnect to shared_preload_libraries and restart the cluster.

```
gpconfig -c shared_preload_libraries -v \
"$(psql -At -c \
"SELECT array_to_string( \
array_append( \
string_to_array( \
current_setting('shared_preload_libraries'), \
','), \
'interconnect'), \
',')" \
postgres)"
gpstop -ra
```

Create the extension in your database.

```
CREATE EXTENSION interconnect;
```
82 changes: 82 additions & 0 deletions contrib/interconnect/expected/interconnect.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
-- Capture current interconnect stats as baseline for future comparisons
SELECT * FROM gp_interconnect_stats \gset prev_
-- Verify that all baseline interconnect statistics are >= 0 (no negative values)
SELECT
:prev_total_recv_queue_size >= 0,
:prev_recv_queue_conting_time >= 0,
:prev_total_capacity >= 0,
:prev_capacity_counting_time >= 0,
:prev_total_buffers >= 0,
:prev_buffer_counting_time >= 0,
:prev_retransmits >= 0,
:prev_startup_cached_pkts >= 0,
:prev_mismatches >= 0,
:prev_crs_errors >= 0,
:prev_snd_pkt_num >= 0,
:prev_recv_pkt_num >= 0,
:prev_disordered_pkt_num >= 0,
:prev_duplicate_pkt_num >= 0,
:prev_recv_ack_num >= 0,
:prev_status_query_msg_num >= 0;
?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column?
----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------
t | t | t | t | t | t | t | t | t | t | t | t | t | t | t | t
(1 row)

-- Create test table to generate interconnect traffic
CREATE TABLE test_ic_data
AS SELECT generate_series(1, 1000) AS id
DISTRIBUTED RANDOMLY;
-- Re-capture current state: overwrite prev with latest values
SELECT * FROM gp_interconnect_stats \gset prev2_
-- Check if current statistics are >= baseline values after first data insertion
SELECT
:prev2_total_recv_queue_size >= :prev_total_recv_queue_size,
:prev2_recv_queue_conting_time >= :prev_recv_queue_conting_time,
:prev2_total_capacity >= :prev_total_capacity,
:prev2_capacity_counting_time >= :prev_capacity_counting_time,
:prev2_total_buffers >= :prev_total_buffers,
:prev2_buffer_counting_time >= :prev_buffer_counting_time,
:prev2_retransmits >= :prev_retransmits,
:prev2_startup_cached_pkts >= :prev_startup_cached_pkts,
:prev2_mismatches >= :prev_mismatches,
:prev2_crs_errors >= :prev_crs_errors,
:prev2_snd_pkt_num >= :prev_snd_pkt_num,
:prev2_recv_pkt_num >= :prev_recv_pkt_num,
:prev2_disordered_pkt_num >= :prev_disordered_pkt_num,
:prev2_duplicate_pkt_num >= :prev_duplicate_pkt_num,
:prev2_recv_ack_num >= :prev_recv_ack_num,
:prev2_status_query_msg_num >= :prev_status_query_msg_num;
?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column?
----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------
t | t | t | t | t | t | t | t | t | t | t | t | t | t | t | t
(1 row)

-- Insert additional data to further test interconnect statistics changes under load
INSERT INTO test_ic_data SELECT generate_series(1001, 2000);
-- Re‑check if current statistics remain >= baseline after second data insertion
SELECT
total_recv_queue_size >= :prev2_total_recv_queue_size,
recv_queue_conting_time >= :prev2_recv_queue_conting_time,
total_capacity >= :prev2_total_capacity,
capacity_counting_time >= :prev2_capacity_counting_time,
total_buffers >= :prev2_total_buffers,
buffer_counting_time >= :prev2_buffer_counting_time,
retransmits >= :prev2_retransmits,
startup_cached_pkts >= :prev2_startup_cached_pkts,
mismatches >= :prev2_mismatches,
crs_errors >= :prev2_crs_errors,
snd_pkt_num >= :prev2_snd_pkt_num,
recv_pkt_num >= :prev2_recv_pkt_num,
disordered_pkt_num >= :prev2_disordered_pkt_num,
duplicate_pkt_num >= :prev2_duplicate_pkt_num,
recv_ack_num >= :prev2_recv_ack_num,
status_query_msg_num >= :prev2_status_query_msg_num
FROM gp_interconnect_stats;
?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? | ?column?
----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------
t | t | t | t | t | t | t | t | t | t | t | t | t | t | t | t
(1 row)

DROP TABLE test_ic_data;
DROP EXTENSION interconnect;
Loading
Loading