Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:import braft #130

Merged

Conversation

panlei-coder
Copy link
Collaborator

@panlei-coder panlei-coder commented Jan 16, 2024

Import the third-party library braft,目前是把braft的example的counter文件夹直接copy到了pikiwidb/src目录下作为子文件夹编译的,主要是为了验证braft引入的正确性,后面合并的时候会删除掉

@github-actions github-actions bot added the ✏️ Feature New feature or request label Jan 16, 2024
@panlei-coder panlei-coder added the help wanted Extra attention is needed label Jan 16, 2024
@panlei-coder panlei-coder marked this pull request as draft January 16, 2024 01:40
@panlei-coder panlei-coder marked this pull request as ready for review January 18, 2024 09:22
panlei-coder and others added 2 commits January 18, 2024 17:35
* feat: import braft

* fix: fix braft.cmake

* fix:fix import braft cmake

* fix: fix fetchcontent_populate

* fix: fix find gflags brpc braft cmake

* add independent code and fix brpc

* fix: delete unnecessary comments

* fix: fix fetch content to ExternalProject_Add

* fix: add counter.pb.h and counter.pb.cc

---------

Co-authored-by: century <919745273@qq.com>
…ation#134)

* feat: import braft

* fix: fix braft.cmake

* fix:fix import braft cmake

* fix: fix fetchcontent_populate

* fix: fix find gflags brpc braft cmake

* add independent code and fix brpc

* fix: delete unnecessary comments

* fix: fix fetch content to ExternalProject_Add

* fix: add counter.pb.h and counter.pb.cc

* fix: fixed a bug where the compiler could not find glog

---------

Co-authored-by: century <919745273@qq.com>
@hotjump
Copy link
Collaborator

hotjump commented Jan 27, 2024

image
zlib这里会有安装的问题

@hotjump
Copy link
Collaborator

hotjump commented Jan 27, 2024

image

在docker环境里这个CPU个数好像是不对的,会导致make并发数很大。

@zzzczh
Copy link

zzzczh commented Jan 27, 2024

引入braft到counter模块之外模块的问题
1.单独链接braft库会有brpc的undefine,不过我看文档TARGET_LINK_LIBRARIES应该有传递性,应该不需要引入braft的依赖?在我的环境必须要链接所有的依赖才能链接成功
TARGET_LINK_LIBRARIES(pikiwidb braft brpc ssl crypto zlib protobuf leveldb gflags glog net; dl; leveldb; fmt; pikiwidb-folly; storage; rocksdb)
2.引入braft到storage模块会有glog的的undefine,但是cmake文件中已经引入了glog,而且storage本来就引入了glog。初步猜测是受到brpc braft禁用了glog的影响?

@panlei-coder panlei-coder force-pushed the import-braft branch 2 times, most recently from a64e4ca to fbc8b0c Compare February 27, 2024 05:49
cmake/protobuf.cmake Outdated Show resolved Hide resolved
cmake/protobuf.cmake Outdated Show resolved Hide resolved
@@ -0,0 +1,996 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不应该被ignore掉嘛?怎么还能提交上来

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没啥问题了 整个文件夹都会删掉 单纯的做验证引入是否正确用的

SET(BRAFT_INCLUDE_DIR "${BRAFT_INSTALL_DIR}/include" CACHE PATH "braft include directory." FORCE)
SET(BRAFT_LIBRARIES "${BRAFT_INSTALL_DIR}/lib/libbraft.a" CACHE FILEPATH "braft library." FORCE)

SET(NUM_OF_PROCESSOR 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pikiwidb里的cmake有一个代码是获取cpu核数的,可以复用那个代码。只用一个cpu编译会比较慢。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

@@ -12,7 +12,7 @@ import (
"log"
"strconv"
"time"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里好像是一个没必要的空格?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

longfar-ncy
longfar-ncy previously approved these changes Mar 6, 2024
@dingxiaoshuai123 dingxiaoshuai123 changed the base branch from unstable to import-braft March 6, 2024 08:48
@dingxiaoshuai123 dingxiaoshuai123 changed the base branch from import-braft to unstable March 6, 2024 08:50
@dingxiaoshuai123 dingxiaoshuai123 dismissed stale reviews from longfar-ncy and themself March 6, 2024 08:50

The base branch was changed.

@dingxiaoshuai123 dingxiaoshuai123 changed the base branch from unstable to import-braft March 6, 2024 08:54
@dingxiaoshuai123 dingxiaoshuai123 merged commit 973b426 into OpenAtomFoundation:import-braft Mar 6, 2024
8 checks passed
dingxiaoshuai123 added a commit to dingxiaoshuai123/pikiwidb that referenced this pull request Mar 25, 2024
* feat: import braft
---------

Co-authored-by: century <919745273@qq.com>
Co-authored-by: alexstocks <alexstocks@foxmail.com>
Co-authored-by: dingxiaoshuai123 <2486016589@qq.com>
@Mixficsol Mixficsol mentioned this pull request Apr 15, 2024
21 tasks
AlexStocks added a commit that referenced this pull request May 6, 2024
* feat:import braft (#130)

* feat:  Implementing Redis-Raft commands to build a cluster. (#136)

Co-authored-by: panlei-coder <panleiCSDN@163.com>
Co-authored-by: century <919745273@qq.com>
Co-authored-by: panlei-coder <62509266+panlei-coder@users.noreply.github.com>
Co-authored-by: alexstocks <alexstocks@foxmail.com>
Co-authored-by: dingxiaoshuai123 <2486016589@qq.com>
Co-authored-by: longfar <ningchangyuan@nuaa.edu.cn>
@panlei-coder panlei-coder deleted the import-braft branch May 13, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.1.0 cluster core ✏️ Feature New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants