Skip to content

Commit bee1b10

Browse files
Besroyyawzhang
andauthored
update nuraft version to 2.4.9 (#144)
This change add nuraft new fix on add_member and add more logs on snapshot handler Co-authored-by: yawzhang <yawzhang@ebay.com>
1 parent 3aab495 commit bee1b10

4 files changed

Lines changed: 200 additions & 3 deletions

File tree

3rd_party/nuraft/conandata.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
sources:
2+
"2.4.9":
3+
url: "https://github.com/eBay/nuraft/archive/10f7e79b06d843f840b84cb7887bace1f89349ef.tar.gz"
4+
sha256: "6f94d875dfc324840ddf28ace2807729ab76a9aac5e652b8dddc04a8ab9a99fa"
25
"2.4.8":
36
url: "https://github.com/eBay/nuraft/archive/57356df58e461b8dfddc698c412c99d1d16ee250.tar.gz"
47
sha256: "06064f15e7a142d306ad13ea855b98c424ff05e404b5bc990f8e4688418cb499"
@@ -29,6 +32,10 @@ sources:
2932
"2.3.0":
3033
url: "https://github.com/eBay/nuraft/archive/f42b12c3ec9f20a085de61e1294e8167fa747c7d.tar.gz"
3134
patches:
35+
"2.4.9":
36+
- patch_file: "patches/2-4-9.patch"
37+
patch_description: "Dependency discovery"
38+
patch_type: "conan"
3239
"2.4.8":
3340
- patch_file: "patches/2-4-7.patch"
3441
patch_description: "Dependency discovery"
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
--- CMakeLists.txt.orig 2026-01-14 08:12:10
2+
+++ CMakeLists.txt 2026-01-14 16:24:36
3+
@@ -48,9 +48,9 @@
4+
if(WITH_CONAN)
5+
if(NOT DISABLE_ASIO)
6+
if(BOOST_ASIO)
7+
- find_package(Boost REQUIRED)
8+
+ find_package(Boost REQUIRED COMPONENTS Boost::system)
9+
add_compile_definitions(USE_BOOST_ASIO)
10+
- set(LIBBOOST_SYSTEM boost::boost)
11+
+ set(LIBBOOST_SYSTEM Boost::system)
12+
else()
13+
find_package(Asio REQUIRED)
14+
add_compile_definitions(ASIO_STANDALONE)
15+
@@ -76,42 +76,23 @@
16+
else()
17+
if(NOT DISABLE_ASIO)
18+
# === Find ASIO ===
19+
- if(BOOST_INCLUDE_PATH AND BOOST_LIBRARY_PATH)
20+
+ find_package(OpenSSL CONFIG REQUIRED)
21+
+ find_package(Boost CONFIG)
22+
+ if (Boost_FOUND)
23+
# If Boost path (both include and library) is given,
24+
# use Boost's ASIO.
25+
- message(STATUS "Boost include path: " ${BOOST_INCLUDE_PATH})
26+
- message(STATUS "Boost library path: " ${BOOST_LIBRARY_PATH})
27+
-
28+
add_compile_definitions(USE_BOOST_ASIO)
29+
-
30+
- set(ASIO_INCLUDE_DIR ${BOOST_INCLUDE_PATH})
31+
- set(LIBBOOST_SYSTEM "${BOOST_LIBRARY_PATH}/libboost_system.a")
32+
-
33+
+ set(ASIO_DEP boost::boost)
34+
else()
35+
# If not, ASIO standalone mode.
36+
- find_path(ASIO_INCLUDE_DIR
37+
- NAME asio.hpp
38+
- HINTS ${PROJECT_SOURCE_DIR}/asio/asio/include
39+
- $ENV{HOME}/local/include
40+
- /opt/local/include
41+
- /usr/local/include
42+
- /usr/include)
43+
-
44+
+ find_package(Asio CONFIG REQUIRED)
45+
add_compile_definitions(ASIO_STANDALONE)
46+
+ set(ASIO_DEP asio::asio)
47+
endif()
48+
set(ASIO_SERVICE_SRC "${ROOT_SRC}/asio_service.cxx")
49+
else()
50+
message(STATUS "ASIO is disabled and will not be included")
51+
endif()
52+
-
53+
- if(NOT ASIO_INCLUDE_DIR)
54+
- message(FATAL_ERROR "Can't find ASIO header files")
55+
- else()
56+
- message(STATUS "ASIO include path: " ${ASIO_INCLUDE_DIR})
57+
- endif()
58+
-
59+
- # === Includes ===
60+
- include_directories(BEFORE ${ASIO_INCLUDE_DIR})
61+
62+
if(DEPS_PREFIX)
63+
message(STATUS "deps prefix: " ${DEPS_PREFIX})
64+
@@ -191,7 +172,9 @@
65+
set(LIBRARIES
66+
${LIBSSL}
67+
${LIBCRYPTO}
68+
- ${LIBBOOST_SYSTEM})
69+
+ ${LIBBOOST_SYSTEM}
70+
+ ${LIBDL}
71+
+ ${LIBZ})
72+
73+
# === Compiler flags ===
74+
option(USE_PTHREAD_EXIT "Call pthread_exit on server threads" OFF)
75+
@@ -200,20 +183,8 @@
76+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
77+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pessimizing-move")
78+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
79+
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
80+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
81+
82+
- if(APPLE)
83+
- # include_directories(BEFORE
84+
- # /usr/local/opt/openssl/include
85+
- # )
86+
- # link_directories(
87+
- # /usr/local/opt/openssl/lib
88+
- # )
89+
- else()
90+
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
91+
- endif()
92+
-
93+
if(USE_PTHREAD_EXIT)
94+
message(STATUS "Using ::pthread_exit for termination")
95+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_PTHREAD_EXIT")
96+
@@ -331,90 +302,16 @@
97+
${ROOT_SRC}/stat_mgr.cxx
98+
)
99+
add_library(RAFT_CORE_OBJ OBJECT ${RAFT_CORE})
100+
-target_link_libraries(RAFT_CORE_OBJ ${LIBRARIES})
101+
+target_link_libraries(RAFT_CORE_OBJ ${ASIO_DEP} ${LIBRARIES})
102+
103+
set(STATIC_LIB_SRC
104+
$<TARGET_OBJECTS:RAFT_CORE_OBJ>)
105+
106+
-# === Executables ===
107+
-set(LIBRARY_NAME "nuraft")
108+
-
109+
-add_library(static_lib ${STATIC_LIB_SRC})
110+
-add_library(NuRaft::static_lib ALIAS static_lib)
111+
-set_target_properties(static_lib PROPERTIES OUTPUT_NAME ${LIBRARY_NAME} CLEAN_DIRECT_OUTPUT 1)
112+
-
113+
-add_library(shared_lib SHARED ${STATIC_LIB_SRC})
114+
-add_library(NuRaft::shared_lib ALIAS shared_lib)
115+
-set_target_properties(shared_lib PROPERTIES OUTPUT_NAME ${LIBRARY_NAME} CLEAN_DIRECT_OUTPUT 1)
116+
-
117+
-# Include directories are necessary for dependents to use the targets.
118+
-target_include_directories(static_lib
119+
- PUBLIC
120+
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
121+
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
122+
-)
123+
+add_library(nuraft ${STATIC_LIB_SRC})
124+
+target_link_libraries(nuraft ${ASIO_DEP} openssl::openssl)
125+
126+
-target_include_directories(shared_lib
127+
- PUBLIC
128+
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
129+
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
130+
-)
131+
-
132+
-# if (APPLE)
133+
-# There is no harm in adding libraries; this is required when building with Conan
134+
-target_link_libraries(shared_lib ${LIBRARIES})
135+
-target_link_libraries(static_lib ${LIBRARIES})
136+
-
137+
-# endif ()
138+
-if(WIN32)
139+
- set(LIBRARY_OUTPUT_NAME "${LIBRARY_NAME}.lib")
140+
-else()
141+
- set(LIBRARY_OUTPUT_NAME "lib${LIBRARY_NAME}.a")
142+
-endif()
143+
-
144+
-message(STATUS "Output library file name: ${LIBRARY_OUTPUT_NAME}")
145+
-
146+
-# overwrite to set it to target name instead which passes all lib dependencies to tests and examples
147+
-set(LIBRARY_NAME static_lib)
148+
-
149+
-# === Examples ===
150+
-if(BUILD_EXAMPLES AND NOT DISABLE_ASIO)
151+
- add_subdirectory(examples)
152+
-endif()
153+
-
154+
-# === Tests ===
155+
-if(BUILD_TESTING)
156+
- add_subdirectory(tests)
157+
-endif()
158+
-
159+
-if(CODE_COVERAGE GREATER 0)
160+
- set(CODE_COVERAGE_DEPS
161+
- buffer_test
162+
- serialization_test
163+
- strfmt_test
164+
- stat_mgr_test
165+
- raft_server_test
166+
- snapshot_test
167+
- leader_election_test
168+
- learner_new_joiner_test
169+
- failure_test
170+
- timer_test
171+
- asio_service_test
172+
- req_resp_meta_test
173+
- stream_transport_layer_test
174+
- raft_stream_mode_test
175+
- )
176+
-
177+
- # lcov
178+
- SETUP_TARGET_FOR_COVERAGE(
179+
- NAME raft_cov
180+
- EXECUTABLE ./runtests.sh
181+
- DEPENDENCIES ${CODE_COVERAGE_DEPS}
182+
- )
183+
-endif()
184+
-
185+
# === Install Targets ===
186+
-install(TARGETS shared_lib static_lib
187+
+install(TARGETS nuraft
188+
EXPORT nuraft-targets
189+
LIBRARY DESTINATION lib
190+
ARCHIVE DESTINATION lib

conanfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class NuRaftMesgConan(ConanFile):
1313
name = "nuraft_mesg"
14-
version = "4.0.1"
14+
version = "4.0.2"
1515
homepage = "https://github.com/eBay/nuraft_mesg"
1616
description = "A gRPC service for NuRAFT"
1717
topics = ("ebay", "nublox", "raft")
@@ -65,7 +65,7 @@ def build_requirements(self):
6565

6666
def requirements(self):
6767
self.requires("sisl/[>=13]@oss/master", transitive_headers=True)
68-
self.requires("nuraft/2.4.8", transitive_headers=True)
68+
self.requires("nuraft/2.4.9", transitive_headers=True)
6969

7070
def layout(self):
7171
self.folders.source = "."

prepare_v2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ conan export 3rd_party/forestdb --name forestdb --version cci.20250315 >/dev/nul
66
echo -n "jungle."
77
conan export 3rd_party/jungle --name jungle --version cci.20250316 >/dev/null
88
echo -n "nuraft."
9-
conan export 3rd_party/nuraft --name nuraft --version 2.4.8 >/dev/null
9+
conan export 3rd_party/nuraft --name nuraft --version 2.4.9 >/dev/null
1010
echo "done."

0 commit comments

Comments
 (0)