Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
a5cdfc1
add the progressive read idle timout checker
zchuango Nov 25, 2025
ae7bc0f
modify the bug for http c++ example
zchuango Nov 25, 2025
e41c37b
Merge branch 'apache:master' into master
zchuango Nov 28, 2025
f08f266
change the timeout checker bthread to timer bthread
zchuango Nov 28, 2025
f373b45
Merge branch 'apache:master' into master
zchuango Dec 3, 2025
9bd8016
refine ProgressiveReadTimeoutReader class hold SocketId and read_time…
zchuango Dec 3, 2025
8830eab
Prog read timeout dev merge (#4)
zchuango Dec 5, 2025
6f301da
Prog read timeout dev (#5)
zchuango Dec 10, 2025
f46c3b3
Merge branch 'apache:master' into master
zchuango Jan 13, 2026
cbdbb52
Merge branch 'apache:master' into master
zchuango Jan 26, 2026
c3b095f
Merge branch 'apache:master' into master
zchuango Apr 11, 2026
6c06fd4
Merge branch 'apache:master' into master
zchuango May 9, 2026
bad9a84
Add UrmaTransport: URMA-based remote memory transport with CI mock
Gzure Jul 21, 2026
d8cdefa
Merge branch 'zchuango:master' into master
Gzure Jul 22, 2026
4bb562f
Remove vendored URMA SDK headers and simplify to v2-only binary hands…
Gzure Jul 22, 2026
eaae5f7
Restore v3 protobuf handshake (v2+v3 dual, aligned with RDMA)
Gzure Jul 22, 2026
eb133be
Merge remote-tracking branch 'origin/master' into urma-transport
Gzure Jul 22, 2026
d93b8e0
Fix proto compile error: uint8 is not a valid protobuf type
Gzure Jul 28, 2026
629f37a
Add bundled SDK headers under src/brpc/urma/sdk/ for mock-mode compil…
Gzure Jul 28, 2026
59cbe75
Fix find_path for system URMA SDK at /usr/include/ub/umdk/urma/
Gzure Jul 28, 2026
12f23c7
Fix find_path to search /usr/include/ub/umdk/ for URMA SDK headers
Gzure Jul 28, 2026
15ff975
Fix compile errors: Socket friend access, missing constants, type mis…
Gzure Jul 28, 2026
9092a73
修复编译问题
Gzure Jul 29, 2026
f175292
修复urma问题
Gzure Jul 29, 2026
f08c98f
merge master
Gzure Jul 29, 2026
6dc3000
修复编译问题
Gzure Jul 29, 2026
f10eb22
修复urma performance编译
Gzure Jul 29, 2026
9acab4c
修复server问题
Gzure Jul 29, 2026
da53b7a
fix
Gzure Jul 29, 2026
5497f01
fix
Gzure Jul 29, 2026
118b636
fix
Gzure Jul 29, 2026
170c03d
fix
Gzure Jul 29, 2026
df368cb
添加bond支持
Gzure Jul 29, 2026
22f9122
fix
Gzure Jul 29, 2026
23a95bc
fix
Gzure Jul 29, 2026
43e26de
fix
Gzure Jul 29, 2026
66efe80
fix
Gzure Jul 29, 2026
0802d91
fix
Gzure Jul 29, 2026
7ba58e8
Fix URMA bonding jetty association during peer import
Gzure Jul 29, 2026
47d0965
fix
Gzure Jul 29, 2026
29a257b
fix
Gzure Jul 29, 2026
74a02b3
log
Gzure Jul 30, 2026
50df229
fix
Gzure Jul 30, 2026
9940f00
fix
Gzure Jul 30, 2026
74df9f7
fix
Gzure Jul 30, 2026
eae3543
fix
Gzure Jul 30, 2026
2f7a114
fix
Gzure Jul 30, 2026
4a7f05d
fix
Gzure Jul 30, 2026
6566fd4
fix
Gzure Jul 30, 2026
e997ee0
fix
Gzure Jul 30, 2026
7846d3f
fix
Gzure Jul 30, 2026
0b27d99
clean
Gzure Jul 30, 2026
dacec97
fix ut
Gzure Jul 30, 2026
cafa4af
去掉urma sdk
Gzure Jul 30, 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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ CTestTestfile.cmake
/test/out.txt
/test/recordio_ref.io

# Local design notes and Graphify artifacts.
docs/cn/urma_proposal.md
graphify-out/

# Ignore protoc-gen-mcpack files
/protoc-gen-mcpack*/

Expand Down
13 changes: 10 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ DEFINES = [
}) + select({
"//bazel/config:brpc_with_rdma": ["BRPC_WITH_RDMA=1"],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_urma": ["BRPC_WITH_URMA=1"],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_debug_bthread_sche_safety": ["BRPC_DEBUG_BTHREAD_SCHE_SAFETY=1"],
"//conditions:default": ["BRPC_DEBUG_BTHREAD_SCHE_SAFETY=0"],
Expand Down Expand Up @@ -509,6 +512,7 @@ filegroup(
"src/brpc/*.proto",
"src/brpc/policy/*.proto",
"src/brpc/rdma/*.proto",
"src/brpc/urma/*.proto",
]),
visibility = ["//visibility:public"],
)
Expand Down Expand Up @@ -547,9 +551,7 @@ cc_library(
"src/brpc/event_dispatcher_kqueue.cpp",
]),
copts = COPTS,
includes = [
"src/",
],
includes = ["src/"],
linkopts = LINKOPTS,
visibility = ["//visibility:public"],
deps = [
Expand All @@ -561,6 +563,11 @@ cc_library(
":mcpack2pb",
"@com_github_google_leveldb//:leveldb",
] + select({
"//bazel/config:brpc_with_urma": [
"@umdk//:urma_headers",
],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_thrift": [
"@org_apache_thrift//:thrift",
],
Expand Down
84 changes: 83 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ option(WITH_THRIFT "With thrift framed protocol supported" OFF)
option(WITH_BTHREAD_TRACER "With bthread tracer supported" OFF)
option(WITH_SNAPPY "With snappy" OFF)
option(WITH_RDMA "With RDMA" OFF)
option(WITH_URMA "With URMA (openEuler Unified Remote Memory Access)" OFF)
option(DOWNLOAD_URMA_HEADERS
"Download UMDK headers when WITH_URMA is enabled and headers are absent"
ON)
option(WITH_UBRING "With UB" OFF)
option(WITH_DEBUG_BTHREAD_SCHE_SAFETY "With debugging bthread sche safety" OFF)
option(WITH_DEBUG_LOCK "With debugging lock" OFF)
Expand Down Expand Up @@ -114,6 +118,11 @@ if(WITH_RDMA)
set(WITH_RDMA_VAL "1")
endif()

set(WITH_URMA_VAL "0")
if(WITH_URMA)
set(WITH_URMA_VAL "1")
endif()

set(WITH_UBRING_VAL "0")
if(WITH_UBRING)
set(WITH_UBRING_VAL "1")
Expand Down Expand Up @@ -153,6 +162,7 @@ endif()
list(APPEND BRPC_COMMON_DEFINITIONS
BRPC_WITH_GLOG=${WITH_GLOG_VAL}
BRPC_WITH_RDMA=${WITH_RDMA_VAL}
BRPC_WITH_URMA=${WITH_URMA_VAL}
BRPC_WITH_UBRING=${WITH_UBRING_VAL}
BRPC_DEBUG_BTHREAD_SCHE_SAFETY=${WITH_DEBUG_BTHREAD_SCHE_SAFETY_VAL}
BRPC_DEBUG_LOCK=${WITH_DEBUG_LOCK_VAL}
Expand Down Expand Up @@ -309,6 +319,56 @@ if(WITH_RDMA)
list(APPEND BRPC_COMMON_INCLUDE_DIRS ${RDMA_INCLUDE_PATH})
endif()

if(WITH_URMA)
# UrmaTransport and its link-time mock both compile against the upstream
# UMDK API. Prefer installed headers; otherwise fetch a pinned upstream
# release, following Mooncake's URMA mock setup.
find_path(URMA_INCLUDE_PATH NAMES urma_api.h
HINTS ENV URMA_ROOT
PATHS /usr/include /usr/local/include
PATH_SUFFIXES ub/umdk/urma umdk/urma urma
src/urma/lib/urma/core/include)
find_path(URMA_BOND_INCLUDE_PATH NAMES urma_ubagg.h
HINTS ENV URMA_ROOT
PATHS /usr/include /usr/local/include
PATH_SUFFIXES ub/umdk/urma umdk/urma urma
src/urma/lib/urma/bond/include)
if(NOT URMA_INCLUDE_PATH AND DOWNLOAD_URMA_HEADERS)
include(FetchContent)
FetchContent_Declare(
urma_headers
GIT_REPOSITORY https://atomgit.com/openeuler/umdk.git
GIT_TAG v26.06.0_CAM
GIT_SHALLOW TRUE)
FetchContent_GetProperties(urma_headers)
if(NOT urma_headers_POPULATED)
FetchContent_Populate(urma_headers)
endif()
set(URMA_INCLUDE_PATH
"${urma_headers_SOURCE_DIR}/src/urma/lib/urma/core/include")
set(URMA_BOND_INCLUDE_PATH
"${urma_headers_SOURCE_DIR}/src/urma/lib/urma/bond/include")
message(STATUS "Using downloaded UMDK headers: ${URMA_INCLUDE_PATH}")
endif()
if(NOT URMA_INCLUDE_PATH)
message(FATAL_ERROR
"Fail to find urma_api.h. Install UMDK headers, set URMA_ROOT, "
"or enable DOWNLOAD_URMA_HEADERS.")
endif()

find_library(URMA_LIB NAMES urma
HINTS ENV URMA_ROOT
PATH_SUFFIXES lib lib64)
if(URMA_LIB)
message(STATUS "Found URMA library: ${URMA_LIB}")
set(URMA_USE_MOCK 0)
else()
message(STATUS
"liburma not found; building with the URMA link-time mock")
set(URMA_USE_MOCK 1)
endif()
endif()

find_library(PROTOC_LIB NAMES protoc)
if(NOT PROTOC_LIB)
message(FATAL_ERROR "Fail to find protoc lib")
Expand All @@ -333,6 +393,12 @@ list(APPEND BRPC_COMMON_INCLUDE_DIRS
${PROTOBUF_INCLUDE_DIRS}
${LEVELDB_INCLUDE_PATH}
)
if(WITH_URMA)
list(APPEND BRPC_COMMON_INCLUDE_DIRS ${URMA_INCLUDE_PATH})
if(URMA_BOND_INCLUDE_PATH)
list(APPEND BRPC_COMMON_INCLUDE_DIRS ${URMA_BOND_INCLUDE_PATH})
endif()
endif()

set(DYNAMIC_LIB
${GFLAGS_LIBRARY}
Expand Down Expand Up @@ -361,6 +427,13 @@ if(WITH_RDMA)
list(APPEND DYNAMIC_LIB ${RDMA_LIB})
endif()

if(WITH_URMA)
message(STATUS "brpc compile with URMA (mock=${URMA_USE_MOCK})")
if(NOT URMA_USE_MOCK)
list(APPEND DYNAMIC_LIB ${URMA_LIB})
endif()
endif()

if(WITH_UBRING)
message(STATUS "brpc compile with ubring")
list(APPEND DYNAMIC_LIB ${UB_LIB})
Expand Down Expand Up @@ -566,6 +639,14 @@ file(GLOB_RECURSE BRPC_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/brpc
file(GLOB_RECURSE THRIFT_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/brpc/thrift*.cpp")
file(GLOB_RECURSE EXCLUDE_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/brpc/event_dispatcher_*.cpp")

# When building with the real liburma, exclude the link-time mock so its urma_*
# symbols do not clash with the library. When liburma is absent, keep it so CI
# can build and test UrmaTransport without URMA hardware.
if(WITH_URMA AND NOT URMA_USE_MOCK)
list(REMOVE_ITEM BRPC_SOURCES
"${PROJECT_SOURCE_DIR}/src/brpc/urma/mock_urma.cpp")
endif()

if(WITH_THRIFT)
message("brpc compile with thrift protocol")
else()
Expand Down Expand Up @@ -606,7 +687,8 @@ set(PROTO_FILES idl_options.proto
brpc/trackme.proto
brpc/streaming_rpc_meta.proto
brpc/proto_base.proto
brpc/rdma/rdma_handshake.proto)
brpc/rdma/rdma_handshake.proto
brpc/urma/urma_handshake.proto)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/output/include/brpc)
set(PROTOC_FLAGS ${PROTOC_FLAGS} -I${PROTOBUF_INCLUDE_DIR})
compile_proto(PROTO_HDRS PROTO_SRCS ${PROJECT_BINARY_DIR}
Expand Down
11 changes: 11 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,14 @@ git_override(
remote = 'https://github.com/hedronvision/bazel-compile-commands-extractor.git',
commit = '1e08f8e0507b6b6b1f4416a9a22cf5c28beaba93', # Jun 28, 2024
)

git_repository = use_repo_rule(
'@bazel_tools//tools/build_defs/repo:git.bzl',
'git_repository',
)
git_repository(
name = 'umdk',
build_file = '//bazel/third_party/umdk:umdk.BUILD',
remote = 'https://atomgit.com/openeuler/umdk.git',
tag = 'v26.06.0_CAM',
)
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,15 @@ JSON2PB_SOURCES = $(foreach d,$(JSON2PB_DIRS),$(wildcard $(addprefix $(d)/*,$(SR
JSON2PB_OBJS = $(addsuffix .o, $(basename $(JSON2PB_SOURCES)))

BRPC_DIRS = src/brpc src/brpc/details src/brpc/builtin src/brpc/policy src/brpc/policy/mysql src/brpc/rdma
ifeq ($(WITH_URMA),1)
BRPC_DIRS += src/brpc/urma
endif
THRIFT_SOURCES = $(foreach d,$(BRPC_DIRS),$(wildcard $(addprefix $(d)/thrift*,$(SRCEXTS))))
EXCLUDE_SOURCES = $(foreach d,$(BRPC_DIRS),$(wildcard $(addprefix $(d)/event_dispatcher_*,$(SRCEXTS))))
BRPC_SOURCES_ALL = $(foreach d,$(BRPC_DIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS))))
ifeq ($(URMA_USE_MOCK),0)
BRPC_SOURCES_ALL := $(filter-out src/brpc/urma/mock_urma.cpp,$(BRPC_SOURCES_ALL))
endif
BRPC_SOURCES = $(filter-out $(THRIFT_SOURCES) $(EXCLUDE_SOURCES), $(BRPC_SOURCES_ALL))
BRPC_PROTOS = $(filter %.proto,$(BRPC_SOURCES))
BRPC_CFAMILIES = $(filter-out %.proto %.pb.cc,$(BRPC_SOURCES))
Expand Down
9 changes: 8 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ http_archive(
urls = ["https://archive.apache.org/dist/thrift/0.15.0/thrift-0.15.0.tar.gz"],
)

git_repository(
name = "umdk",
build_file = "//bazel/third_party/umdk:umdk.BUILD",
remote = "https://atomgit.com/openeuler/umdk.git",
tag = "v26.06.0_CAM",
)

# Header-only JSON library used by iobuf_unittest's IOBuf<->std::iostream
# adapter tests. Keep version in sync with MODULE.bazel.
http_archive(
Expand Down Expand Up @@ -317,4 +324,4 @@ http_archive(
sha256 = "3cd0e49f0f4a6d406c1d74b53b7616f5e24f5fd319eafc1bf8eee6e14124d115",
)
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
hedron_compile_commands_setup()
hedron_compile_commands_setup()
8 changes: 7 additions & 1 deletion bazel/config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ config_setting(
visibility = ["//visibility:public"],
)

config_setting(
name = "brpc_with_urma",
define_values = {"BRPC_WITH_URMA": "true"},
visibility = ["//visibility:public"],
)

config_setting(
name = "brpc_with_boringssl",
define_values = {"BRPC_WITH_BORINGSSL": "true"},
Expand Down Expand Up @@ -149,4 +155,4 @@ config_setting(
name = "with_babylon_counter",
define_values = {"with_babylon_counter": "true"},
visibility = ["//visibility:public"],
)
)
28 changes: 28 additions & 0 deletions bazel/third_party/umdk/umdk.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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.

package(default_visibility = ["//visibility:public"])

cc_library(
name = "urma_headers",
hdrs = glob([
"src/urma/lib/urma/bond/include/*.h",
"src/urma/lib/urma/core/include/*.h",
]),
includes = [
"src/urma/lib/urma/bond/include",
"src/urma/lib/urma/core/include",
],
)
25 changes: 24 additions & 1 deletion config_brpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ else
LDD=ldd
fi

TEMP=`getopt -o v: --long headers:,libs:,cc:,cxx:,with-glog,with-thrift,with-rdma,with-mesalink,with-bthread-tracer,with-debug-bthread-sche-safety,with-debug-lock,with-asan,with-riscv-zvbc,with-riscv-zbc,nodebugsymbols,werror -n 'config_brpc' -- "$@"`
TEMP=`getopt -o v: --long headers:,libs:,cc:,cxx:,with-glog,with-thrift,with-rdma,with-urma,with-mesalink,with-bthread-tracer,with-debug-bthread-sche-safety,with-debug-lock,with-asan,with-riscv-zvbc,with-riscv-zbc,nodebugsymbols,werror -n 'config_brpc' -- "$@"`
WITH_GLOG=0
WITH_THRIFT=0
WITH_RDMA=0
WITH_URMA=0
WITH_MESALINK=0
WITH_BTHREAD_TRACER=0
WITH_ASAN=0
Expand Down Expand Up @@ -89,6 +90,7 @@ while true; do
--with-glog ) WITH_GLOG=1; shift 1 ;;
--with-thrift) WITH_THRIFT=1; shift 1 ;;
--with-rdma) WITH_RDMA=1; shift 1 ;;
--with-urma) WITH_URMA=1; shift 1 ;;
--with-mesalink) WITH_MESALINK=1; shift 1 ;;
--with-bthread-tracer) WITH_BTHREAD_TRACER=1; shift 1 ;;
--with-debug-bthread-sche-safety ) BRPC_DEBUG_BTHREAD_SCHE_SAFETY=1; shift 1 ;;
Expand Down Expand Up @@ -536,6 +538,26 @@ if [ $WITH_RDMA != 0 ]; then
append_to_output "WITH_RDMA=1"
fi

if [ $WITH_URMA != 0 ]; then
URMA_LIB=$(find_dir_of_lib urma)
URMA_HDR=$(find_dir_of_header_or_die urma_api.h)
URMA_BOND_HDR=$(find_dir_of_header urma_ubagg.h)
CPPFLAGS="${CPPFLAGS} -DBRPC_WITH_URMA=1"
append_to_output "WITH_URMA=1"
append_to_output_headers "$URMA_HDR"
if [ -n "$URMA_BOND_HDR" ]; then
append_to_output_headers "$URMA_BOND_HDR"
fi
if [ -n "$URMA_LIB" ]; then
append_to_output_libs "$URMA_LIB"
append_to_output "DYNAMIC_LINKINGS+=-lurma"
append_to_output "URMA_USE_MOCK=0"
else
append_to_output "URMA_USE_MOCK=1"
print_info "liburma not found; using URMA link-time mock"
fi
fi

if [ $WITH_MESALINK != 0 ]; then
CPPFLAGS="${CPPFLAGS} -DUSE_MESALINK"
fi
Expand Down Expand Up @@ -667,6 +689,7 @@ print_info "System: $SYSTEM"
if [ $WITH_GLOG -ne 0 ]; then print_info "With glog: yes"; fi
if [ $WITH_THRIFT -ne 0 ]; then print_info "With thrift: yes"; fi
if [ $WITH_RDMA -ne 0 ]; then print_info "With RDMA: yes"; fi
if [ $WITH_URMA -ne 0 ]; then print_info "With URMA: yes"; fi
if [ $WITH_MESALINK -ne 0 ]; then print_info "With MesaLink: yes"; fi
if [ $WITH_BTHREAD_TRACER -ne 0 ]; then print_info "With bthread tracer: yes"; fi
if [ $WITH_ASAN -ne 0 ]; then print_info "With ASAN: yes"; fi
Expand Down
Loading
Loading