diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index 85df78b2182..ff1d72c25f0 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -132,6 +132,7 @@ jobs:
-DCMAKE_CXX_COMPILER=$TOOLSET_CLANG_DIR/bin/clang++ \
-DCMAKE_C_COMPILER=$TOOLSET_CLANG_DIR/bin/clang \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DENABLE_MEMORY_TRACKER=off \
-DENABLE_ASAN=on \
-DENABLE_TESTING=on \
-GNinja \
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d5c55196392..6fdb7b827d9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,21 @@ if (ENABLE_NATIVE)
add_compile_options(-fPIC)
endif()
+if(ENABLE_MEMORY_TRACKER)
+ if(ENABLE_JEMALLOC)
+ if(NOT ENABLE_ASAN)
+ add_definitions(-DENABLE_MEMORY_TRACKER)
+ message(STATUS "MemoryTracker is ENABLED")
+ else()
+ message(FATAL_ERROR "MemoryTracker need -DENABLE_ASAN=off")
+ endif()
+ else()
+ message(FATAL_ERROR "MemoryTracker need -DENABLE_JEMALLOC=on")
+ endif()
+else()
+ message(WARNING "MemoryTracker is DISABLED")
+endif()
+
include_directories(AFTER ${CMAKE_SOURCE_DIR}/src)
include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/src)
diff --git a/README-CN.md b/README-CN.md
index fc2d5231815..7a2fcd7fc3b 100644
--- a/README-CN.md
+++ b/README-CN.md
@@ -8,21 +8,16 @@
-
-
-
-
-
-
-
+
-
+
+
# NebulaGraph 是什么?
@@ -108,13 +103,18 @@ NebulaGraph内核 1.x 与 2.x 数据格式、通信协议、客户端等均双
* 访问[官网](http://nebula-graph.com.cn/)
* [![WeiXin](https://img.shields.io/badge/WeChat-%E5%BE%AE%E4%BF%A1-brightgreen)](https://user-images.githubusercontent.com/38887077/67449282-4362b300-f64c-11e9-878f-7efc373e5e55.jpg)
* [![Sina Weibo](https://img.shields.io/badge/Weibo-%E5%BE%AE%E5%8D%9A-red)](https://weibo.com/p/1006067122684542/home?from=page_100606&mod=TAB#place)
-* [知乎](https://www.zhihu.com/org/nebulagraph/activities)
-* [SegmentFault](https://segmentfault.com/t/nebula)
* Email: info@vesoft.com
## 加入 NebulaGraph 社区
-[![Discussions](https://img.shields.io/badge/GitHub_Discussion-000000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/vesoft-inc/nebula/discussions) [![Discourse](https://img.shields.io/badge/中文论坛-4285F4?style=for-the-badge&logo=discourse&logoColor=white)](https://discuss.nebula-graph.com.cn/) [![Slack](https://img.shields.io/badge/Slack-9F2B68?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/nebulagraph/shared_invite/zt-7ybejuqa-NCZBroh~PCh66d9kOQj45g) [![Tencent_Meeting](https://img.shields.io/badge/腾讯会议-2D8CFF?style=for-the-badge&logo=googlemeet&logoColor=white)](https://meeting.tencent.com/dm/F8NX1aRZ8PQv) [![Google Calendar](https://img.shields.io/badge/Calander-4285F4?style=for-the-badge&logo=google&logoColor=white)](https://calendar.google.com/calendar/u/0?cid=Z29mbGttamM3ZTVlZ2hpazI2cmNlNXVnZThAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ) [![Meetup](https://img.shields.io/badge/Meetup-FF0000?style=for-the-badge&logo=meetup&logoColor=white)](https://www.meetup.com/nebulagraph/events/287180186?utm_medium=referral&utm_campaign=share-btn_savedevents_share_modal&utm_source=link) [![Meeting Archive](https://img.shields.io/badge/Community_wiki-808080?style=for-the-badge&logo=readthedocs&logoColor=white)](https://github.com/vesoft-inc/nebula-community/wiki)
+
+
+| 加入 NebulaGraph 社区 | 加入方式 |
+| ----------------------- | ------------------------------------------------------------ |
+| 微信群 | [![WeChat Group](https://img.shields.io/badge/微信群-000000?style=for-the-badge&logo=wechat)](https://wj.qq.com/s2/8321168/8e2f/) |
+| 提问 | [![Discourse](https://img.shields.io/badge/中文论坛-4285F4?style=for-the-badge&logo=discourse&logoColor=white)](https://discuss.nebula-graph.com.cn/) [![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-nebula--graph-orange?style=for-the-badge&logo=stack-overflow&logoColor=white)](https://stackoverflow.com/questions/tagged/nebula-graph) [![Discussions](https://img.shields.io/badge/GitHub_Discussion-000000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/vesoft-inc/nebula/discussions) |
+| 聊天 | [![Chat History](https://img.shields.io/badge/Community%20Chat-000000?style=for-the-badge&logo=discord&logoColor=white)](https://community-chat.nebula-graph.io/) [![Slack](https://img.shields.io/badge/Slack-9F2B68?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/nebulagraph/shared_invite/zt-7ybejuqa-NCZBroh~PCh66d9kOQj45g) |
+| NebulaGraph Meetup 活动 | [![Tencent_Meeting](https://img.shields.io/badge/腾讯会议-2D8CFF?style=for-the-badge&logo=googlemeet&logoColor=white)](https://meeting.tencent.com/dm/F8NX1aRZ8PQv) [![Google Calendar](https://img.shields.io/badge/Calander-4285F4?style=for-the-badge&logo=google&logoColor=white)](https://calendar.google.com/calendar/u/0?cid=Z29mbGttamM3ZTVlZ2hpazI2cmNlNXVnZThAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ) [![Zoom](https://img.shields.io/badge/Zoom-2D8CFF?style=for-the-badge&logo=zoom&logoColor=white)](https://us02web.zoom.us/meeting/register/tZ0rcuypqDMvGdLuIm4VprTlx96wrEf062SH) [![Meetup](https://img.shields.io/badge/Meetup-FF0000?style=for-the-badge&logo=meetup&logoColor=white)](https://www.meetup.com/nebulagraph/events/) [![Meeting Archive](https://img.shields.io/badge/Meeting_Archive-808080?style=for-the-badge&logo=readthedocs&logoColor=white)](https://github.com/vesoft-inc/nebula-community/wiki) |
diff --git a/README.md b/README.md
index 2ef22e51cb3..c525b32996a 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,9 @@
A distributed, scalable, lightning-fast graph database
+
+
+
@@ -107,15 +110,21 @@ You can also freely deploy **NebulaGraph** as a back-end service to support your
## Contact
+* [Community Chat](https://community-chat.nebula-graph.io/)
* [Slack Channel](https://join.slack.com/t/nebulagraph/shared_invite/zt-7ybejuqa-NCZBroh~PCh66d9kOQj45g)
-* [Stack Overflow](https://stackoverflow.com/questions/tagged/nebulagraph)
+* [Stack Overflow](https://stackoverflow.com/questions/tagged/nebula-graph)
* Twitter: [@NebulaGraph](https://twitter.com/NebulaGraph)
-* [LinkedIn Page](https://www.linkedin.com/company/vesoft-nebula-graph)
+* [LinkedIn Page](https://www.linkedin.com/company/nebula-graph/)
* Email: info@vesoft.com
## Community
-[![Discussions](https://img.shields.io/badge/GitHub_Discussion-000000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/vesoft-inc/nebula/discussions) [![Slack](https://img.shields.io/badge/Slack-9F2B68?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/nebulagraph/shared_invite/zt-7ybejuqa-NCZBroh~PCh66d9kOQj45g) [![Zoom](https://img.shields.io/badge/Zoom-2D8CFF?style=for-the-badge&logo=zoom&logoColor=white)](https://us02web.zoom.us/meeting/register/tZ0rcuypqDMvGdLuIm4VprTlx96wrEf062SH) [![Google Calendar](https://img.shields.io/badge/Calander-4285F4?style=for-the-badge&logo=google&logoColor=white)](https://calendar.google.com/calendar/u/0?cid=Z29mbGttamM3ZTVlZ2hpazI2cmNlNXVnZThAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ) [![Meetup](https://img.shields.io/badge/Meetup-FF0000?style=for-the-badge&logo=meetup&logoColor=white)](https://www.meetup.com/nebulagraph/events/287180186?utm_medium=referral&utm_campaign=share-btn_savedevents_share_modal&utm_source=link) [![Meeting Archive](https://img.shields.io/badge/Community_wiki-808080?style=for-the-badge&logo=readthedocs&logoColor=white)](https://github.com/vesoft-inc/nebula-community/wiki) [![Discourse](https://img.shields.io/badge/中文论坛-4285F4?style=for-the-badge&logo=discourse&logoColor=white)](https://discuss.nebula-graph.com.cn/) [![Tencent_Meeting](https://img.shields.io/badge/腾讯会议-2D8CFF?style=for-the-badge&logo=googlemeet&logoColor=white)](https://meeting.tencent.com/dm/F8NX1aRZ8PQv)
+| Join NebulaGraph Community | Where to Find us |
+| ----------------------------------- | ------------------------------------------------------------ |
+| Asking Questions | [![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-nebula--graph-orange?style=for-the-badge&logo=stack-overflow&logoColor=white)](https://stackoverflow.com/questions/tagged/nebula-graph) [![Discussions](https://img.shields.io/badge/GitHub_Discussion-000000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/vesoft-inc/nebula/discussions) |
+| Chat with Community Members | [![Chat History](https://img.shields.io/badge/Community%20Chat-000000?style=for-the-badge&logo=discord&logoColor=white)](https://community-chat.nebula-graph.io/) [![Slack](https://img.shields.io/badge/Slack-9F2B68?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/nebulagraph/shared_invite/zt-7ybejuqa-NCZBroh~PCh66d9kOQj45g) |
+| NebulaGraph Meetup | [![Google Calendar](https://img.shields.io/badge/Calander-4285F4?style=for-the-badge&logo=google&logoColor=white)](https://calendar.google.com/calendar/u/0?cid=Z29mbGttamM3ZTVlZ2hpazI2cmNlNXVnZThAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ) [![Zoom](https://img.shields.io/badge/Zoom-2D8CFF?style=for-the-badge&logo=zoom&logoColor=white)](https://us02web.zoom.us/meeting/register/tZ0rcuypqDMvGdLuIm4VprTlx96wrEf062SH) [![Meetup](https://img.shields.io/badge/Meetup-FF0000?style=for-the-badge&logo=meetup&logoColor=white)](https://www.meetup.com/nebulagraph/events/) [![Meeting Archive](https://img.shields.io/badge/Meeting_Archive-808080?style=for-the-badge&logo=readthedocs&logoColor=white)](https://github.com/vesoft-inc/nebula-community/wiki) |
+| Chat, Asking, or Meeting in Chinese | [![WeChat Group](https://img.shields.io/badge/WeChat_Group-000000?style=for-the-badge&logo=wechat)](https://wj.qq.com/s2/8321168/8e2f/) [![Tencent_Meeting](https://img.shields.io/badge/腾讯会议-2D8CFF?style=for-the-badge&logo=googlemeet&logoColor=white)](https://meeting.tencent.com/dm/F8NX1aRZ8PQv) [![Discourse](https://img.shields.io/badge/中文论坛-4285F4?style=for-the-badge&logo=discourse&logoColor=white)](https://discuss.nebula-graph.com.cn/) |
diff --git a/cmake/nebula/GeneralCMakeOptions.cmake b/cmake/nebula/GeneralCMakeOptions.cmake
index aaf3f1ea0e6..0e3c855b3e9 100644
--- a/cmake/nebula/GeneralCMakeOptions.cmake
+++ b/cmake/nebula/GeneralCMakeOptions.cmake
@@ -20,6 +20,7 @@ option(ENABLE_GDB_SCRIPT_SECTION "Add .debug_gdb_scripts section" OFF)
option(DISABLE_CXX11_ABI "Whether to disable cxx11 abi" OFF)
option(ENABLE_BREAKPAD "Whether to enable breakpad" OFF)
option(ENABLE_STANDALONE_VERSION "Enable standalone version build" OFF)
+option(ENABLE_MEMORY_TRACKER "Enable memory tracker" ON)
get_cmake_property(variable_list VARIABLES)
foreach(_varname ${variable_list})
diff --git a/cmake/nebula/SanitizerConfig.cmake b/cmake/nebula/SanitizerConfig.cmake
index 28b5d500ef4..9f610e819a3 100644
--- a/cmake/nebula/SanitizerConfig.cmake
+++ b/cmake/nebula/SanitizerConfig.cmake
@@ -15,6 +15,7 @@ if(ENABLE_ASAN)
add_compile_options(-fsanitize=address)
add_compile_options(-g)
add_compile_options(-fno-omit-frame-pointer)
+ add_definitions(-DENABLE_ASAN)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif()
diff --git a/conf/nebula-graphd.conf.default b/conf/nebula-graphd.conf.default
index f6eeb7549df..c1be4f72580 100644
--- a/conf/nebula-graphd.conf.default
+++ b/conf/nebula-graphd.conf.default
@@ -27,7 +27,7 @@
--stdout_log_file=graphd-stdout.log
--stderr_log_file=graphd-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
---stderrthreshold=2
+--stderrthreshold=3
# wether logging files' name contain time stamp.
--timestamp_in_logfile_name=true
########## query ##########
@@ -93,3 +93,23 @@
# if use balance data feature, only work if enable_experimental_feature is true
--enable_data_balance=true
+
+########## session ##########
+# Maximum number of sessions that can be created per IP and per user
+--max_sessions_per_ip_per_user=300
+
+########## memory tracker ##########
+# trackable memory ratio (trackable_memory / (total_memory - untracked_reserved_memory) )
+--memory_tracker_limit_ratio=0.8
+# untracked reserved memory in Mib
+--memory_tracker_untracked_reserved_memory_mb=50
+
+# enable log memory tracker stats periodically
+--memory_tracker_detail_log=false
+# log memory tacker stats interval in milliseconds
+--memory_tracker_detail_log_interval_ms=60000
+
+# enable memory background purge (if jemalloc is used)
+--memory_purge_enabled=true
+# memory background purge interval in seconds
+--memory_purge_interval_seconds=10
diff --git a/conf/nebula-graphd.conf.production b/conf/nebula-graphd.conf.production
index e7cfbf3d810..3f1d828d533 100644
--- a/conf/nebula-graphd.conf.production
+++ b/conf/nebula-graphd.conf.production
@@ -25,7 +25,7 @@
--stdout_log_file=graphd-stdout.log
--stderr_log_file=graphd-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
---stderrthreshold=2
+--stderrthreshold=3
# wether logging files' name contain timestamp
--timestamp_in_logfile_name=true
@@ -96,3 +96,19 @@
########## session ##########
# Maximum number of sessions that can be created per IP and per user
--max_sessions_per_ip_per_user=300
+
+########## memory tracker ##########
+# trackable memory ratio (trackable_memory / (total_memory - untracked_reserved_memory) )
+--memory_tracker_limit_ratio=0.8
+# untracked reserved memory in Mib
+--memory_tracker_untracked_reserved_memory_mb=50
+
+# enable log memory tracker stats periodically
+--memory_tracker_detail_log=false
+# log memory tacker stats interval in milliseconds
+--memory_tracker_detail_log_interval_ms=60000
+
+# enable memory background purge (if jemalloc is used)
+--memory_purge_enabled=true
+# memory background purge interval in seconds
+--memory_purge_interval_seconds=10
diff --git a/conf/nebula-metad.conf.default b/conf/nebula-metad.conf.default
index ce9903200a8..89b594f36f5 100644
--- a/conf/nebula-metad.conf.default
+++ b/conf/nebula-metad.conf.default
@@ -19,7 +19,7 @@
--stdout_log_file=metad-stdout.log
--stderr_log_file=metad-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
---stderrthreshold=2
+--stderrthreshold=3
# wether logging files' name contain time stamp, If Using logrotate to rotate logging files, than should set it to true.
--timestamp_in_logfile_name=true
diff --git a/conf/nebula-metad.conf.production b/conf/nebula-metad.conf.production
index 84b18f831d4..3ea93ffac0c 100644
--- a/conf/nebula-metad.conf.production
+++ b/conf/nebula-metad.conf.production
@@ -19,7 +19,7 @@
--stdout_log_file=metad-stdout.log
--stderr_log_file=metad-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
---stderrthreshold=2
+--stderrthreshold=3
# wether logging files' name contain time stamp.
--timestamp_in_logfile_name=true
diff --git a/conf/nebula-standalone.conf.default b/conf/nebula-standalone.conf.default
index 16694304c60..e5f7a449efe 100644
--- a/conf/nebula-standalone.conf.default
+++ b/conf/nebula-standalone.conf.default
@@ -27,7 +27,7 @@
--stdout_log_file=standalone-stdout.log
--stderr_log_file=standalone-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
---stderrthreshold=2
+--stderrthreshold=3
########## query ##########
# Whether to treat partial success as an error.
diff --git a/conf/nebula-storaged-listener.conf.default b/conf/nebula-storaged-listener.conf.default
index 02936b7d192..86d74d3c356 100644
--- a/conf/nebula-storaged-listener.conf.default
+++ b/conf/nebula-storaged-listener.conf.default
@@ -22,7 +22,7 @@
--stdout_log_file=storaged-listener-stdout.log
--stderr_log_file=storaged-listener-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
---stderrthreshold=2
+--stderrthreshold=3
# Wether logging files' name contain timestamp.
--timestamp_in_logfile_name=true
diff --git a/conf/nebula-storaged-listener.conf.production b/conf/nebula-storaged-listener.conf.production
index a8c33d5ba07..72467e7fab1 100644
--- a/conf/nebula-storaged-listener.conf.production
+++ b/conf/nebula-storaged-listener.conf.production
@@ -22,7 +22,7 @@
--stdout_log_file=storaged-listener-stdout.log
--stderr_log_file=storaged-listener-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
---stderrthreshold=2
+--stderrthreshold=3
# Wether logging files' name contain timestamp.
--timestamp_in_logfile_name=true
diff --git a/conf/nebula-storaged.conf.default b/conf/nebula-storaged.conf.default
index c41bbf1cb8e..7746aef5057 100644
--- a/conf/nebula-storaged.conf.default
+++ b/conf/nebula-storaged.conf.default
@@ -21,7 +21,7 @@
--stdout_log_file=storaged-stdout.log
--stderr_log_file=storaged-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
---stderrthreshold=2
+--stderrthreshold=3
# Wether logging files' name contain time stamp.
--timestamp_in_logfile_name=true
@@ -122,3 +122,19 @@
--rebuild_index_part_rate_limit=4194304
# The amount of data sent in each batch when leader synchronizes rebuilding index
--rebuild_index_batch_size=1048576
+
+########## memory tracker ##########
+# trackable memory ratio (trackable_memory / (total_memory - untracked_reserved_memory) )
+--memory_tracker_limit_ratio=0.8
+# untracked reserved memory in Mib
+--memory_tracker_untracked_reserved_memory_mb=50
+
+# enable log memory tracker stats periodically
+--memory_tracker_detail_log=false
+# log memory tacker stats interval in milliseconds
+--memory_tracker_detail_log_interval_ms=60000
+
+# enable memory background purge (if jemalloc is used)
+--memory_purge_enabled=true
+# memory background purge interval in seconds
+--memory_purge_interval_seconds=10
diff --git a/conf/nebula-storaged.conf.production b/conf/nebula-storaged.conf.production
index 0c1bcd34a62..a5f3f64b92a 100644
--- a/conf/nebula-storaged.conf.production
+++ b/conf/nebula-storaged.conf.production
@@ -21,7 +21,7 @@
--stdout_log_file=storaged-listener-stdout.log
--stderr_log_file=storaged-listener-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
---stderrthreshold=2
+--stderrthreshold=3
# Wether logging files' name contain timestamp.
--timestamp_in_logfile_name=true
@@ -123,3 +123,19 @@
--rebuild_index_part_rate_limit=4194304
# The amount of data sent in each batch when leader synchronizes rebuilding index
--rebuild_index_batch_size=1048576
+
+########## memory tracker ##########
+# trackable memory ratio (trackable_memory / (total_memory - untracked_reserved_memory) )
+--memory_tracker_limit_ratio=0.8
+# untracked reserved memory in Mib
+--memory_tracker_untracked_reserved_memory_mb=50
+
+# enable log memory tracker stats periodically
+--memory_tracker_detail_log=false
+# log memory tacker stats interval in milliseconds
+--memory_tracker_detail_log_interval_ms=60000
+
+# enable memory background purge (if jemalloc is used)
+--memory_purge_enabled=true
+# memory background purge interval in seconds
+--memory_purge_interval_seconds=10
diff --git a/package/package.sh b/package/package.sh
index 086eeed03ec..7a006ee6221 100755
--- a/package/package.sh
+++ b/package/package.sh
@@ -197,8 +197,8 @@ function package {
function _find_dump_syms_tool {
if [[ -x ${build_dir}/third-party/install/bin/dump_syms ]]; then
dump_syms_tool_dir=${build_dir}/third-party/install/bin
- elif [[ -x /opt/vesoft/third-party/2.0/bin/dump_syms ]]; then
- dump_syms_tool_dir=/opt/vesoft/third-party/2.0/bin
+ elif [[ -x /opt/vesoft/third-party/3.3/bin/dump_syms ]]; then
+ dump_syms_tool_dir=/opt/vesoft/third-party/3.3/bin
else
echo ">>> Failed to find the dump_syms tool <<<"
exit 1
diff --git a/src/clients/meta/MetaClient.cpp b/src/clients/meta/MetaClient.cpp
index 16482bdfb51..8d0125099e1 100644
--- a/src/clients/meta/MetaClient.cpp
+++ b/src/clients/meta/MetaClient.cpp
@@ -254,6 +254,7 @@ bool MetaClient::loadUsersAndRoles() {
}
bool MetaClient::loadData() {
+ memory::MemoryCheckOffGuard g;
// UNKNOWN role will skip heartbeat
if (options_.role_ != cpp2::HostRole::UNKNOWN &&
localDataLastUpdateTime_ == metadLastUpdateTime_) {
@@ -425,6 +426,7 @@ bool MetaClient::loadData() {
}
TagSchemas MetaClient::buildTagSchemas(std::vector tagItemVec) {
+ memory::MemoryCheckOffGuard g;
TagSchemas tagSchemas;
for (auto& tagIt : tagItemVec) {
// meta will return the different version from new to old
@@ -447,6 +449,7 @@ TagSchemas MetaClient::buildTagSchemas(std::vector tagItemVec) {
}
EdgeSchemas MetaClient::buildEdgeSchemas(std::vector edgeItemVec) {
+ memory::MemoryCheckOffGuard g;
EdgeSchemas edgeSchemas;
std::unordered_set> edges;
for (auto& edgeIt : edgeItemVec) {
@@ -470,6 +473,7 @@ EdgeSchemas MetaClient::buildEdgeSchemas(std::vector edgeItemVec
}
void MetaClient::addSchemaField(NebulaSchemaProvider* schema, const cpp2::ColumnDef& col) {
+ memory::MemoryCheckOffGuard g;
bool hasDef = col.default_value_ref().has_value();
auto& colType = col.get_type();
size_t len = colType.type_length_ref().has_value() ? *colType.get_type_length() : 0;
@@ -493,6 +497,7 @@ bool MetaClient::loadSchemas(GraphSpaceID spaceId,
SpaceNewestTagVerMap& newestTagVerMap,
SpaceNewestEdgeVerMap& newestEdgeVerMap,
SpaceAllEdgeMap& allEdgeMap) {
+ memory::MemoryCheckOffGuard g;
auto tagRet = listTagSchemas(spaceId).get();
if (!tagRet.ok()) {
LOG(ERROR) << "Get tag schemas failed for spaceId " << spaceId << ", " << tagRet.status();
@@ -559,6 +564,7 @@ bool MetaClient::loadSchemas(GraphSpaceID spaceId,
}
Indexes buildIndexes(std::vector indexItemVec) {
+ memory::MemoryCheckOffGuard g;
Indexes indexes;
for (auto index : indexItemVec) {
auto indexName = index.get_index_name();
@@ -570,6 +576,7 @@ Indexes buildIndexes(std::vector indexItemVec) {
}
bool MetaClient::loadIndexes(GraphSpaceID spaceId, std::shared_ptr cache) {
+ memory::MemoryCheckOffGuard g;
auto tagIndexesRet = listTagIndexes(spaceId).get();
if (!tagIndexesRet.ok()) {
LOG(ERROR) << "Get tag indexes failed for spaceId " << spaceId << ", "
@@ -607,6 +614,7 @@ bool MetaClient::loadIndexes(GraphSpaceID spaceId, std::shared_ptr cache) {
+ memory::MemoryCheckOffGuard g;
auto listenerRet = listListener(spaceId).get();
if (!listenerRet.ok()) {
LOG(ERROR) << "Get listeners failed for spaceId " << spaceId << ", " << listenerRet.status();
@@ -622,6 +630,7 @@ bool MetaClient::loadListeners(GraphSpaceID spaceId, std::shared_ptr> MetaClient::reverse(
const PartsAlloc& parts) {
+ memory::MemoryCheckOffGuard g;
std::unordered_map> hosts;
for (auto& partHost : parts) {
for (auto& h : partHost.second) {
@@ -694,6 +707,7 @@ void MetaClient::getResponse(Request req,
bool toLeader,
int32_t retry,
int32_t retryLimit) {
+ memory::MemoryCheckOffGuard g;
stats::StatsManager::addValue(kNumRpcSentToMetad);
auto* evb = ioThreadPool_->getEventBase();
HostAddr host;
@@ -803,6 +817,7 @@ void MetaClient::getResponse(Request req,
}
std::vector MetaClient::toSpaceIdName(const std::vector& tIdNames) {
+ memory::MemoryCheckOffGuard g;
std::vector idNames;
idNames.resize(tIdNames.size());
std::transform(tIdNames.begin(), tIdNames.end(), idNames.begin(), [](const auto& tin) {
@@ -813,6 +828,7 @@ std::vector MetaClient::toSpaceIdName(const std::vector
Status MetaClient::handleResponse(const RESP& resp) {
+ memory::MemoryCheckOffGuard g;
switch (resp.get_code()) {
case nebula::cpp2::ErrorCode::SUCCEEDED:
return Status::OK();
@@ -828,6 +844,8 @@ Status MetaClient::handleResponse(const RESP& resp) {
return Status::Error("No hosts!");
case nebula::cpp2::ErrorCode::E_EXISTED:
return Status::Error("Existed!");
+ case nebula::cpp2::ErrorCode::E_HISTORY_CONFLICT:
+ return Status::Error("Schema exisited before!");
case nebula::cpp2::ErrorCode::E_SPACE_NOT_FOUND:
return Status::SpaceNotFound("Space not existed!");
case nebula::cpp2::ErrorCode::E_TAG_NOT_FOUND:
@@ -977,6 +995,7 @@ Status MetaClient::handleResponse(const RESP& resp) {
}
PartsMap MetaClient::doGetPartsMap(const HostAddr& host, const LocalCache& localCache) {
+ memory::MemoryCheckOffGuard g;
PartsMap partMap;
for (const auto& it : localCache) {
auto spaceId = it.first;
@@ -997,6 +1016,7 @@ PartsMap MetaClient::doGetPartsMap(const HostAddr& host, const LocalCache& local
}
void MetaClient::diff(const LocalCache& oldCache, const LocalCache& newCache) {
+ memory::MemoryCheckOffGuard g;
folly::SharedMutex::WriteHolder holder(listenerLock_);
if (listener_ == nullptr) {
VLOG(3) << "Listener is null!";
@@ -1058,6 +1078,7 @@ void MetaClient::diff(const LocalCache& oldCache, const LocalCache& newCache) {
}
void MetaClient::listenerDiff(const LocalCache& oldCache, const LocalCache& newCache) {
+ memory::MemoryCheckOffGuard g;
folly::SharedMutex::WriteHolder holder(listenerLock_);
if (listener_ == nullptr) {
VLOG(3) << "Listener is null!";
@@ -1167,6 +1188,7 @@ void MetaClient::listenerDiff(const LocalCache& oldCache, const LocalCache& newC
}
void MetaClient::loadRemoteListeners() {
+ memory::MemoryCheckOffGuard g;
folly::SharedMutex::WriteHolder holder(listenerLock_);
if (listener_ == nullptr) {
VLOG(3) << "Listener is null!";
@@ -1192,6 +1214,7 @@ void MetaClient::loadRemoteListeners() {
/// ================================== public methods =================================
PartitionID MetaClient::partId(int32_t numParts, const VertexID id) const {
+ memory::MemoryCheckOffGuard g;
// If the length of the id is 8, we will treat it as int64_t to be compatible
// with the version 1.0
uint64_t vid = 0;
@@ -1208,6 +1231,7 @@ PartitionID MetaClient::partId(int32_t numParts, const VertexID id) const {
folly::Future> MetaClient::submitJob(
GraphSpaceID spaceId, cpp2::JobOp op, cpp2::JobType type, std::vector paras) {
+ memory::MemoryCheckOffGuard g;
cpp2::AdminJobReq req;
req.space_id_ref() = spaceId;
req.op_ref() = op;
@@ -1225,6 +1249,7 @@ folly::Future> MetaClient::submitJob(
folly::Future> MetaClient::createSpace(meta::cpp2::SpaceDesc spaceDesc,
bool ifNotExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::CreateSpaceReq req;
req.properties_ref() = std::move(spaceDesc);
req.if_not_exists_ref() = ifNotExists;
@@ -1240,6 +1265,7 @@ folly::Future> MetaClient::createSpace(meta::cpp2::SpaceD
folly::Future> MetaClient::createSpaceAs(const std::string& oldSpaceName,
const std::string& newSpaceName) {
+ memory::MemoryCheckOffGuard g;
cpp2::CreateSpaceAsReq req;
req.old_space_name_ref() = oldSpaceName;
req.new_space_name_ref() = newSpaceName;
@@ -1254,6 +1280,7 @@ folly::Future> MetaClient::createSpaceAs(const std::strin
}
folly::Future>> MetaClient::listSpaces() {
+ memory::MemoryCheckOffGuard g;
cpp2::ListSpacesReq req;
folly::Promise>> promise;
auto future = promise.getFuture();
@@ -1268,6 +1295,7 @@ folly::Future>> MetaClient::listSpaces() {
}
folly::Future> MetaClient::getSpace(std::string name) {
+ memory::MemoryCheckOffGuard g;
cpp2::GetSpaceReq req;
req.space_name_ref() = std::move(name);
folly::Promise> promise;
@@ -1281,6 +1309,7 @@ folly::Future> MetaClient::getSpace(std::string name)
}
folly::Future> MetaClient::dropSpace(std::string name, const bool ifExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::DropSpaceReq req;
req.space_name_ref() = std::move(name);
req.if_exists_ref() = ifExists;
@@ -1297,6 +1326,7 @@ folly::Future> MetaClient::dropSpace(std::string name, const bool
}
folly::Future> MetaClient::clearSpace(std::string name, const bool ifExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::ClearSpaceReq req;
req.space_name_ref() = std::move(name);
req.if_exists_ref() = ifExists;
@@ -1313,6 +1343,7 @@ folly::Future> MetaClient::clearSpace(std::string name, const boo
}
folly::Future>> MetaClient::listHosts(cpp2::ListHostType tp) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListHostsReq req;
req.type_ref() = tp;
@@ -1329,6 +1360,7 @@ folly::Future>> MetaClient::listHosts(cpp2:
folly::Future> MetaClient::alterSpace(const std::string& spaceName,
meta::cpp2::AlterSpaceOp op,
const std::vector& paras) {
+ memory::MemoryCheckOffGuard g;
cpp2::AlterSpaceReq req;
req.op_ref() = op;
req.space_name_ref() = spaceName;
@@ -1347,6 +1379,7 @@ folly::Future> MetaClient::alterSpace(const std::string& spaceNam
folly::Future>> MetaClient::listParts(
GraphSpaceID spaceId, std::vector partIds) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListPartsReq req;
req.space_id_ref() = spaceId;
req.part_ids_ref() = std::move(partIds);
@@ -1362,6 +1395,7 @@ folly::Future>> MetaClient::listParts(
folly::Future>>>
MetaClient::getPartsAlloc(GraphSpaceID spaceId, PartTerms* partTerms) {
+ memory::MemoryCheckOffGuard g;
cpp2::GetPartsAllocReq req;
req.space_id_ref() = spaceId;
folly::Promise>>> promise;
@@ -1386,6 +1420,7 @@ MetaClient::getPartsAlloc(GraphSpaceID spaceId, PartTerms* partTerms) {
}
StatusOr MetaClient::getSpaceIdByNameFromCache(const std::string& name) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1399,6 +1434,7 @@ StatusOr MetaClient::getSpaceIdByNameFromCache(const std::string&
}
StatusOr MetaClient::getSpaceNameByIdFromCache(GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1414,6 +1450,7 @@ StatusOr MetaClient::getSpaceNameByIdFromCache(GraphSpaceID spaceId
StatusOr MetaClient::getTagIDByNameFromCache(const GraphSpaceID& space,
const std::string& name) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1428,6 +1465,7 @@ StatusOr MetaClient::getTagIDByNameFromCache(const GraphSpaceID& space,
StatusOr MetaClient::getTagNameByIdFromCache(const GraphSpaceID& space,
const TagID& tagId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1442,6 +1480,7 @@ StatusOr MetaClient::getTagNameByIdFromCache(const GraphSpaceID& sp
StatusOr MetaClient::getEdgeTypeByNameFromCache(const GraphSpaceID& space,
const std::string& name) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1456,6 +1495,7 @@ StatusOr MetaClient::getEdgeTypeByNameFromCache(const GraphSpaceID& sp
StatusOr MetaClient::getEdgeNameByTypeFromCache(const GraphSpaceID& space,
const EdgeType edgeType) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1469,6 +1509,7 @@ StatusOr MetaClient::getEdgeNameByTypeFromCache(const GraphSpaceID&
}
StatusOr> MetaClient::getAllEdgeFromCache(const GraphSpaceID& space) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1482,12 +1523,14 @@ StatusOr> MetaClient::getAllEdgeFromCache(const GraphSp
}
PartsMap MetaClient::getPartsMapFromCache(const HostAddr& host) {
+ memory::MemoryCheckOffGuard g;
folly::rcu_reader guard;
const auto& metadata = *metadata_.load();
return doGetPartsMap(host, metadata.localCache_);
}
StatusOr MetaClient::getPartHostsFromCache(GraphSpaceID spaceId, PartitionID partId) {
+ memory::MemoryCheckOffGuard g;
folly::rcu_reader guard;
const auto& metadata = *metadata_.load();
auto it = metadata.localCache_.find(spaceId);
@@ -1509,6 +1552,7 @@ StatusOr MetaClient::getPartHostsFromCache(GraphSpaceID spaceId, Part
Status MetaClient::checkPartExistInCache(const HostAddr& host,
GraphSpaceID spaceId,
PartitionID partId) {
+ memory::MemoryCheckOffGuard g;
folly::rcu_reader guard;
const auto& metadata = *metadata_.load();
auto it = metadata.localCache_.find(spaceId);
@@ -1529,6 +1573,7 @@ Status MetaClient::checkPartExistInCache(const HostAddr& host,
}
Status MetaClient::checkSpaceExistInCache(const HostAddr& host, GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
folly::rcu_reader guard;
const auto& metadata = *metadata_.load();
auto it = metadata.localCache_.find(spaceId);
@@ -1544,6 +1589,7 @@ Status MetaClient::checkSpaceExistInCache(const HostAddr& host, GraphSpaceID spa
}
StatusOr MetaClient::partsNum(GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
folly::rcu_reader guard;
const auto& metadata = *metadata_.load();
auto it = metadata.localCache_.find(spaceId);
@@ -1557,6 +1603,7 @@ folly::Future> MetaClient::createTagSchema(GraphSpaceID spaceId,
std::string name,
cpp2::Schema schema,
bool ifNotExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::CreateTagReq req;
req.space_id_ref() = spaceId;
req.tag_name_ref() = std::move(name);
@@ -1576,6 +1623,7 @@ folly::Future> MetaClient::alterTagSchema(GraphSpaceID spaceId,
std::string name,
std::vector items,
cpp2::SchemaProp schemaProp) {
+ memory::MemoryCheckOffGuard g;
cpp2::AlterTagReq req;
req.space_id_ref() = spaceId;
req.tag_name_ref() = std::move(name);
@@ -1595,6 +1643,7 @@ folly::Future> MetaClient::alterTagSchema(GraphSpaceID spaceId,
folly::Future>> MetaClient::listTagSchemas(
GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListTagsReq req;
req.space_id_ref() = spaceId;
folly::Promise>> promise;
@@ -1610,6 +1659,7 @@ folly::Future>> MetaClient::listTagSchemas(
folly::Future> MetaClient::dropTagSchema(GraphSpaceID spaceId,
std::string tagName,
const bool ifExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::DropTagReq req;
req.space_id_ref() = spaceId;
req.tag_name_ref() = std::move(tagName);
@@ -1629,6 +1679,7 @@ folly::Future> MetaClient::dropTagSchema(GraphSpaceID spaceId,
folly::Future> MetaClient::getTagSchema(GraphSpaceID spaceId,
std::string name,
int64_t version) {
+ memory::MemoryCheckOffGuard g;
cpp2::GetTagReq req;
req.space_id_ref() = spaceId;
req.tag_name_ref() = std::move(name);
@@ -1647,6 +1698,7 @@ folly::Future> MetaClient::createEdgeSchema(GraphSpaceID spac
std::string name,
cpp2::Schema schema,
bool ifNotExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::CreateEdgeReq req;
req.space_id_ref() = spaceId;
req.edge_name_ref() = std::move(name);
@@ -1667,6 +1719,7 @@ folly::Future> MetaClient::alterEdgeSchema(GraphSpaceID spaceId,
std::string name,
std::vector items,
cpp2::SchemaProp schemaProp) {
+ memory::MemoryCheckOffGuard g;
cpp2::AlterEdgeReq req;
req.space_id_ref() = spaceId;
req.edge_name_ref() = std::move(name);
@@ -1686,6 +1739,7 @@ folly::Future> MetaClient::alterEdgeSchema(GraphSpaceID spaceId,
folly::Future>> MetaClient::listEdgeSchemas(
GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListEdgesReq req;
req.space_id_ref() = spaceId;
folly::Promise>> promise;
@@ -1701,6 +1755,7 @@ folly::Future>> MetaClient::listEdgeSchemas
folly::Future> MetaClient::getEdgeSchema(GraphSpaceID spaceId,
std::string name,
SchemaVer version) {
+ memory::MemoryCheckOffGuard g;
cpp2::GetEdgeReq req;
req.space_id_ref() = spaceId;
req.edge_name_ref() = std::move(name);
@@ -1718,6 +1773,7 @@ folly::Future> MetaClient::getEdgeSchema(GraphSpaceID spa
folly::Future> MetaClient::dropEdgeSchema(GraphSpaceID spaceId,
std::string name,
const bool ifExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::DropEdgeReq req;
req.space_id_ref() = spaceId;
req.edge_name_ref() = std::move(name);
@@ -1741,6 +1797,7 @@ folly::Future> MetaClient::createTagIndex(GraphSpaceID spaceID
bool ifNotExists,
const cpp2::IndexParams* indexParams,
const std::string* comment) {
+ memory::MemoryCheckOffGuard g;
cpp2::CreateTagIndexReq req;
req.space_id_ref() = spaceID;
req.index_name_ref() = std::move(indexName);
@@ -1767,6 +1824,7 @@ folly::Future> MetaClient::createTagIndex(GraphSpaceID spaceID
folly::Future> MetaClient::dropTagIndex(GraphSpaceID spaceID,
std::string name,
bool ifExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::DropTagIndexReq req;
req.space_id_ref() = (spaceID);
req.index_name_ref() = (std::move(name));
@@ -1786,6 +1844,7 @@ folly::Future> MetaClient::dropTagIndex(GraphSpaceID spaceID,
folly::Future> MetaClient::getTagIndex(GraphSpaceID spaceID,
std::string name) {
+ memory::MemoryCheckOffGuard g;
cpp2::GetTagIndexReq req;
req.space_id_ref() = spaceID;
req.index_name_ref() = std::move(name);
@@ -1802,6 +1861,7 @@ folly::Future> MetaClient::getTagIndex(GraphSpaceID sp
folly::Future>> MetaClient::listTagIndexes(
GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListTagIndexesReq req;
req.space_id_ref() = spaceId;
@@ -1816,6 +1876,7 @@ folly::Future>> MetaClient::listTagIndexes
}
folly::Future> MetaClient::rebuildTagIndex(GraphSpaceID spaceID, std::string name) {
+ memory::MemoryCheckOffGuard g;
cpp2::RebuildIndexReq req;
req.space_id_ref() = spaceID;
req.index_name_ref() = std::move(name);
@@ -1834,6 +1895,7 @@ folly::Future> MetaClient::rebuildTagIndex(GraphSpaceID spaceID,
folly::Future>> MetaClient::listTagIndexStatus(
GraphSpaceID spaceID) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListIndexStatusReq req;
req.space_id_ref() = spaceID;
@@ -1857,6 +1919,7 @@ folly::Future> MetaClient::createEdgeIndex(
bool ifNotExists,
const cpp2::IndexParams* indexParams,
const std::string* comment) {
+ memory::MemoryCheckOffGuard g;
cpp2::CreateEdgeIndexReq req;
req.space_id_ref() = spaceID;
req.index_name_ref() = std::move(indexName);
@@ -1884,6 +1947,7 @@ folly::Future> MetaClient::createEdgeIndex(
folly::Future> MetaClient::dropEdgeIndex(GraphSpaceID spaceId,
std::string name,
bool ifExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::DropEdgeIndexReq req;
req.space_id_ref() = spaceId;
req.index_name_ref() = std::move(name);
@@ -1903,6 +1967,7 @@ folly::Future> MetaClient::dropEdgeIndex(GraphSpaceID spaceId,
folly::Future> MetaClient::getEdgeIndex(GraphSpaceID spaceId,
std::string name) {
+ memory::MemoryCheckOffGuard g;
cpp2::GetEdgeIndexReq req;
req.space_id_ref() = spaceId;
req.index_name_ref() = std::move(name);
@@ -1919,6 +1984,7 @@ folly::Future> MetaClient::getEdgeIndex(GraphSpaceID s
folly::Future>> MetaClient::listEdgeIndexes(
GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListEdgeIndexesReq req;
req.space_id_ref() = spaceId;
@@ -1935,6 +2001,7 @@ folly::Future>> MetaClient::listEdgeIndexe
}
StatusOr MetaClient::getSpaceVidLen(const GraphSpaceID& spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1954,6 +2021,7 @@ StatusOr MetaClient::getSpaceVidLen(const GraphSpaceID& spaceId) {
}
StatusOr MetaClient::getSpaceVidType(const GraphSpaceID& spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1976,6 +2044,7 @@ StatusOr MetaClient::getSpaceVidType(const GraphSpac
}
StatusOr MetaClient::getSpaceDesc(const GraphSpaceID& spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -1990,6 +2059,7 @@ StatusOr MetaClient::getSpaceDesc(const GraphSpaceID& spaceId)
}
StatusOr MetaClient::getIsolationLevel(GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
auto spaceDescStatus = getSpaceDesc(spaceId);
if (!spaceDescStatus.ok()) {
return spaceDescStatus.status();
@@ -2000,6 +2070,7 @@ StatusOr MetaClient::getIsolationLevel(GraphSpaceID
StatusOr> MetaClient::getTagSchemaFromCache(
GraphSpaceID spaceId, TagID tagID, SchemaVer ver) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2021,6 +2092,7 @@ StatusOr> MetaClient::getTagSchemaFr
StatusOr> MetaClient::getEdgeSchemaFromCache(
GraphSpaceID spaceId, EdgeType edgeType, SchemaVer ver) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2041,6 +2113,7 @@ StatusOr> MetaClient::getEdgeSchemaF
}
StatusOr MetaClient::getAllVerTagSchema(GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2054,6 +2127,7 @@ StatusOr MetaClient::getAllVerTagSchema(GraphSpaceID spaceId) {
}
StatusOr MetaClient::getAllLatestVerTagSchema(const GraphSpaceID& spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2073,6 +2147,7 @@ StatusOr MetaClient::getAllLatestVerTagSchema(const GraphSpaceID& spa
}
StatusOr MetaClient::getAllVerEdgeSchema(GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2086,6 +2161,7 @@ StatusOr MetaClient::getAllVerEdgeSchema(GraphSpaceID spaceId) {
}
StatusOr MetaClient::getAllLatestVerEdgeSchemaFromCache(const GraphSpaceID& spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2105,6 +2181,7 @@ StatusOr MetaClient::getAllLatestVerEdgeSchemaFromCache(const GraphS
}
folly::Future> MetaClient::rebuildEdgeIndex(GraphSpaceID spaceID, std::string name) {
+ memory::MemoryCheckOffGuard g;
cpp2::RebuildIndexReq req;
req.space_id_ref() = spaceID;
req.index_name_ref() = std::move(name);
@@ -2123,6 +2200,7 @@ folly::Future> MetaClient::rebuildEdgeIndex(GraphSpaceID spaceID,
folly::Future>> MetaClient::listEdgeIndexStatus(
GraphSpaceID spaceID) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListIndexStatusReq req;
req.space_id_ref() = spaceID;
@@ -2140,6 +2218,7 @@ folly::Future>> MetaClient::listEdgeInde
StatusOr> MetaClient::getTagIndexByNameFromCache(
const GraphSpaceID space, const std::string& name) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2158,6 +2237,7 @@ StatusOr> MetaClient::getTagIndexByNameFromCach
StatusOr> MetaClient::getEdgeIndexByNameFromCache(
const GraphSpaceID space, const std::string& name) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2176,6 +2256,7 @@ StatusOr> MetaClient::getEdgeIndexByNameFromCac
StatusOr> MetaClient::getTagIndexFromCache(GraphSpaceID spaceId,
IndexID indexID) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2199,6 +2280,7 @@ StatusOr> MetaClient::getTagIndexFromCache(Grap
StatusOr MetaClient::getRelatedTagIDByIndexNameFromCache(const GraphSpaceID space,
const std::string& indexName) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2214,6 +2296,7 @@ StatusOr MetaClient::getRelatedTagIDByIndexNameFromCache(const GraphSpace
StatusOr> MetaClient::getEdgeIndexFromCache(GraphSpaceID spaceId,
IndexID indexId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2237,6 +2320,7 @@ StatusOr> MetaClient::getEdgeIndexFromCache(Gra
StatusOr MetaClient::getRelatedEdgeTypeByIndexNameFromCache(
const GraphSpaceID space, const std::string& indexName) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2252,6 +2336,7 @@ StatusOr MetaClient::getRelatedEdgeTypeByIndexNameFromCache(
StatusOr>> MetaClient::getTagIndexesFromCache(
GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2276,6 +2361,7 @@ StatusOr>> MetaClient::getTagIndexe
StatusOr>> MetaClient::getEdgeIndexesFromCache(
GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2299,6 +2385,7 @@ StatusOr>> MetaClient::getEdgeIndex
}
StatusOr MetaClient::getStorageLeaderFromCache(GraphSpaceID spaceId, PartitionID partId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2330,18 +2417,21 @@ StatusOr MetaClient::getStorageLeaderFromCache(GraphSpaceID spaceId, P
void MetaClient::updateStorageLeader(GraphSpaceID spaceId,
PartitionID partId,
const HostAddr& leader) {
+ memory::MemoryCheckOffGuard g;
VLOG(1) << "Update the leader for [" << spaceId << ", " << partId << "] to " << leader;
folly::SharedMutex::WriteHolder holder(leadersLock_);
leadersInfo_.leaderMap_[{spaceId, partId}] = leader;
}
void MetaClient::invalidStorageLeader(GraphSpaceID spaceId, PartitionID partId) {
+ memory::MemoryCheckOffGuard g;
VLOG(1) << "Invalidate the leader for [" << spaceId << ", " << partId << "]";
folly::SharedMutex::WriteHolder holder(leadersLock_);
leadersInfo_.leaderMap_.erase({spaceId, partId});
}
StatusOr MetaClient::getLeaderInfo() {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2354,6 +2444,7 @@ const std::vector& MetaClient::getAddresses() {
}
std::vector MetaClient::getRolesByUserFromCache(const std::string& user) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return std::vector(0);
}
@@ -2367,6 +2458,7 @@ std::vector MetaClient::getRolesByUserFromCache(const std::strin
}
Status MetaClient::authCheckFromCache(const std::string& account, const std::string& password) {
+ memory::MemoryCheckOffGuard g;
// Check meta service status
if (!ready_) {
return Status::Error("Meta Service not ready");
@@ -2435,6 +2527,7 @@ Status MetaClient::authCheckFromCache(const std::string& account, const std::str
}
bool MetaClient::checkShadowAccountFromCache(const std::string& account) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return false;
}
@@ -2448,6 +2541,7 @@ bool MetaClient::checkShadowAccountFromCache(const std::string& account) {
}
StatusOr MetaClient::getTermFromCache(GraphSpaceID spaceId, PartitionID partId) {
+ memory::MemoryCheckOffGuard g;
folly::rcu_reader guard;
const auto& metadata = *metadata_.load();
auto spaceInfo = metadata.localCache_.find(spaceId);
@@ -2464,6 +2558,7 @@ StatusOr MetaClient::getTermFromCache(GraphSpaceID spaceId, PartitionID
}
StatusOr> MetaClient::getStorageHosts() {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2475,6 +2570,7 @@ StatusOr> MetaClient::getStorageHosts() {
StatusOr MetaClient::getLatestTagVersionFromCache(const GraphSpaceID& space,
const TagID& tagId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2489,6 +2585,7 @@ StatusOr MetaClient::getLatestTagVersionFromCache(const GraphSpaceID&
StatusOr MetaClient::getLatestEdgeVersionFromCache(const GraphSpaceID& space,
const EdgeType& edgeType) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2502,6 +2599,7 @@ StatusOr MetaClient::getLatestEdgeVersionFromCache(const GraphSpaceID
}
folly::Future> MetaClient::heartbeat() {
+ memory::MemoryCheckOffGuard g;
cpp2::HBReq req;
req.host_ref() = options_.localHost_;
req.role_ref() = options_.role_;
@@ -2571,7 +2669,7 @@ folly::Future> MetaClient::heartbeat() {
if (FileBasedClusterIdMan::persistInFile(resp.get_cluster_id(), FLAGS_cluster_id_path)) {
options_.clusterId_.store(resp.get_cluster_id());
} else {
- LOG(DFATAL) << "Can't persist the clusterId in file " << FLAGS_cluster_id_path;
+ DLOG(FATAL) << "Can't persist the clusterId in file " << FLAGS_cluster_id_path;
return false;
}
}
@@ -2594,6 +2692,7 @@ folly::Future> MetaClient::heartbeat() {
folly::Future> MetaClient::createUser(std::string account,
std::string password,
bool ifNotExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::CreateUserReq req;
req.account_ref() = std::move(account);
req.encoded_pwd_ref() = std::move(password);
@@ -2611,6 +2710,7 @@ folly::Future> MetaClient::createUser(std::string account,
}
folly::Future> MetaClient::dropUser(std::string account, bool ifExists) {
+ memory::MemoryCheckOffGuard g;
cpp2::DropUserReq req;
req.account_ref() = std::move(account);
req.if_exists_ref() = ifExists;
@@ -2627,6 +2727,7 @@ folly::Future> MetaClient::dropUser(std::string account, bool ifE
}
folly::Future> MetaClient::alterUser(std::string account, std::string password) {
+ memory::MemoryCheckOffGuard g;
cpp2::AlterUserReq req;
req.account_ref() = std::move(account);
req.encoded_pwd_ref() = std::move(password);
@@ -2643,6 +2744,7 @@ folly::Future> MetaClient::alterUser(std::string account, std::st
}
folly::Future> MetaClient::grantToUser(cpp2::RoleItem roleItem) {
+ memory::MemoryCheckOffGuard g;
cpp2::GrantRoleReq req;
req.role_item_ref() = std::move(roleItem);
folly::Promise> promise;
@@ -2658,6 +2760,7 @@ folly::Future> MetaClient::grantToUser(cpp2::RoleItem roleItem) {
}
folly::Future> MetaClient::revokeFromUser(cpp2::RoleItem roleItem) {
+ memory::MemoryCheckOffGuard g;
cpp2::RevokeRoleReq req;
req.role_item_ref() = std::move(roleItem);
folly::Promise> promise;
@@ -2673,6 +2776,7 @@ folly::Future> MetaClient::revokeFromUser(cpp2::RoleItem roleItem
}
folly::Future>> MetaClient::listUsers() {
+ memory::MemoryCheckOffGuard g;
cpp2::ListUsersReq req;
folly::Promise>> promise;
auto future = promise.getFuture();
@@ -2685,6 +2789,7 @@ folly::Future>> MetaClient
}
folly::Future>> MetaClient::listRoles(GraphSpaceID space) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListRolesReq req;
req.space_id_ref() = std::move(space);
folly::Promise>> promise;
@@ -2700,6 +2805,7 @@ folly::Future>> MetaClient::listRoles(Graph
folly::Future> MetaClient::changePassword(std::string account,
std::string newPwd,
std::string oldPwd) {
+ memory::MemoryCheckOffGuard g;
cpp2::ChangePasswordReq req;
req.account_ref() = std::move(account);
req.new_encoded_pwd_ref() = std::move(newPwd);
@@ -2717,6 +2823,7 @@ folly::Future> MetaClient::changePassword(std::string account,
}
folly::Future>> MetaClient::getUserRoles(std::string account) {
+ memory::MemoryCheckOffGuard g;
cpp2::GetUserRolesReq req;
req.account_ref() = std::move(account);
folly::Promise>> promise;
@@ -2730,6 +2837,7 @@ folly::Future>> MetaClient::getUserRoles(st
}
folly::Future> MetaClient::regConfig(const std::vector& items) {
+ memory::MemoryCheckOffGuard g;
cpp2::RegConfigReq req;
req.items_ref() = items;
folly::Promise> promise;
@@ -2746,6 +2854,7 @@ folly::Future> MetaClient::regConfig(const std::vector>> MetaClient::getConfig(
const cpp2::ConfigModule& module, const std::string& name) {
+ memory::MemoryCheckOffGuard g;
if (!configReady_) {
return Status::Error("Not ready!");
}
@@ -2767,6 +2876,7 @@ folly::Future>> MetaClient::getConfig(
folly::Future> MetaClient::setConfig(const cpp2::ConfigModule& module,
const std::string& name,
const Value& value) {
+ memory::MemoryCheckOffGuard g;
cpp2::ConfigItem item;
item.module_ref() = module;
item.name_ref() = name;
@@ -2788,6 +2898,7 @@ folly::Future> MetaClient::setConfig(const cpp2::ConfigModule& mo
folly::Future>> MetaClient::listConfigs(
const cpp2::ConfigModule& module) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListConfigsReq req;
req.module_ref() = module;
folly::Promise>> promise;
@@ -2801,6 +2912,7 @@ folly::Future>> MetaClient::listConfigs(
}
folly::Future> MetaClient::createSnapshot() {
+ memory::MemoryCheckOffGuard g;
cpp2::CreateSnapshotReq req;
folly::Promise> promise;
auto future = promise.getFuture();
@@ -2818,6 +2930,7 @@ folly::Future> MetaClient::createSnapshot() {
}
folly::Future> MetaClient::dropSnapshot(const std::string& name) {
+ memory::MemoryCheckOffGuard g;
cpp2::DropSnapshotReq req;
std::vector names{name};
req.names_ref() = names;
@@ -2834,6 +2947,7 @@ folly::Future> MetaClient::dropSnapshot(const std::string& name)
}
folly::Future>> MetaClient::listSnapshots() {
+ memory::MemoryCheckOffGuard g;
cpp2::ListSnapshotsReq req;
folly::Promise>> promise;
auto future = promise.getFuture();
@@ -2850,6 +2964,7 @@ folly::Future>> MetaClient::listSnapshots()
folly::Future> MetaClient::addListener(GraphSpaceID spaceId,
cpp2::ListenerType type,
std::vector hosts) {
+ memory::MemoryCheckOffGuard g;
cpp2::AddListenerReq req;
req.space_id_ref() = spaceId;
req.type_ref() = type;
@@ -2868,6 +2983,7 @@ folly::Future> MetaClient::addListener(GraphSpaceID spaceId,
folly::Future> MetaClient::removeListener(GraphSpaceID spaceId,
cpp2::ListenerType type) {
+ memory::MemoryCheckOffGuard g;
cpp2::RemoveListenerReq req;
req.space_id_ref() = spaceId;
req.type_ref() = type;
@@ -2885,6 +3001,7 @@ folly::Future> MetaClient::removeListener(GraphSpaceID spaceId,
folly::Future>> MetaClient::listListener(
GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
cpp2::ListListenerReq req;
req.space_id_ref() = spaceId;
folly::Promise>> promise;
@@ -2900,6 +3017,7 @@ folly::Future>> MetaClient::listListene
}
bool MetaClient::registerCfg() {
+ memory::MemoryCheckOffGuard g;
auto ret = regConfig(gflagsDeclared_).get();
if (ret.ok()) {
LOG(INFO) << "Register gflags ok " << gflagsDeclared_.size();
@@ -2910,6 +3028,7 @@ bool MetaClient::registerCfg() {
StatusOr>>
MetaClient::getListenersBySpaceHostFromCache(GraphSpaceID spaceId, const HostAddr& host) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2930,6 +3049,7 @@ MetaClient::getListenersBySpaceHostFromCache(GraphSpaceID spaceId, const HostAdd
}
StatusOr MetaClient::getListenersByHostFromCache(const HostAddr& host) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2939,6 +3059,7 @@ StatusOr MetaClient::getListenersByHostFromCache(const HostAddr& h
}
ListenersMap MetaClient::doGetListenersMap(const HostAddr& host, const LocalCache& localCache) {
+ memory::MemoryCheckOffGuard g;
ListenersMap listenersMap;
for (const auto& space : localCache) {
auto spaceId = space.first;
@@ -2968,6 +3089,7 @@ ListenersMap MetaClient::doGetListenersMap(const HostAddr& host, const LocalCach
StatusOr MetaClient::getListenerHostsBySpacePartType(GraphSpaceID spaceId,
PartitionID partId,
cpp2::ListenerType type) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -2990,6 +3112,7 @@ StatusOr MetaClient::getListenerHostsBySpacePartType(GraphSpaceID spac
StatusOr> MetaClient::getListenerHostTypeBySpacePartType(
GraphSpaceID spaceId, PartitionID partId) {
+ memory::MemoryCheckOffGuard g;
if (!ready_) {
return Status::Error("Not ready!");
}
@@ -3015,6 +3138,7 @@ StatusOr> MetaClient::getListenerHostTypeBySpace
}
bool MetaClient::loadCfg() {
+ memory::MemoryCheckOffGuard g;
// UNKNOWN role will skip heartbeat
if (options_.skipConfig_ || (options_.role_ != cpp2::HostRole::UNKNOWN &&
localCfgLastUpdateTime_ == metadLastUpdateTime_)) {
@@ -3055,6 +3179,7 @@ bool MetaClient::loadCfg() {
}
void MetaClient::updateGflagsValue(const cpp2::ConfigItem& item) {
+ memory::MemoryCheckOffGuard g;
if (item.get_mode() != cpp2::ConfigMode::MUTABLE) {
return;
}
@@ -3083,6 +3208,7 @@ void MetaClient::updateGflagsValue(const cpp2::ConfigItem& item) {
}
void MetaClient::updateNestedGflags(const std::unordered_map& nameValues) {
+ memory::MemoryCheckOffGuard g;
std::unordered_map optionMap;
for (const auto& value : nameValues) {
optionMap.emplace(value.first, value.second.toString());
@@ -3096,12 +3222,14 @@ void MetaClient::updateNestedGflags(const std::unordered_map
}
Status MetaClient::refreshCache() {
+ memory::MemoryCheckOffGuard g;
auto ret = bgThread_->addTask(&MetaClient::loadData, this).get();
return ret ? Status::OK() : Status::Error("Load data failed");
}
void MetaClient::loadLeader(const std::vector& hostItems,
const SpaceNameIdMap& spaceIndexByName) {
+ memory::MemoryCheckOffGuard g;
LeaderInfo leaderInfo;
for (auto& item : hostItems) {
for (auto& spaceEntry : item.get_leader_parts()) {
@@ -3141,6 +3269,7 @@ void MetaClient::loadLeader(const std::vector& hostItems,
}
folly::Future> MetaClient::addHosts(std::vector hosts) {
+ memory::MemoryCheckOffGuard g;
cpp2::AddHostsReq req;
req.hosts_ref() = std::move(hosts);
@@ -3157,6 +3286,7 @@ folly::Future> MetaClient::addHosts(std::vector hosts)
}
folly::Future> MetaClient::dropHosts(std::vector hosts) {
+ memory::MemoryCheckOffGuard g;
cpp2::DropHostsReq req;
req.hosts_ref() = std::move(hosts);
@@ -3174,6 +3304,7 @@ folly::Future> MetaClient::dropHosts(std::vector hosts)
folly::Future> MetaClient::mergeZone(std::vector zones,
std::string zoneName) {
+ memory::MemoryCheckOffGuard g;
cpp2::MergeZoneReq req;
req.zone_name_ref() = std::move(zoneName);
req.zones_ref() = std::move(zones);
@@ -3191,6 +3322,7 @@ folly::Future> MetaClient::mergeZone(std::vector zon
folly::Future> MetaClient::divideZone(
std::string zoneName, std::unordered_map> zoneItems) {
+ memory::MemoryCheckOffGuard g;
cpp2::DivideZoneReq req;
req.zone_name_ref() = std::move(zoneName);
req.zone_items_ref() = std::move(zoneItems);
@@ -3208,6 +3340,7 @@ folly::Future> MetaClient::divideZone(
folly::Future> MetaClient::renameZone(std::string originalZoneName,
std::string zoneName) {
+ memory::MemoryCheckOffGuard g;
cpp2::RenameZoneReq req;
req.original_zone_name_ref() = std::move(originalZoneName);
req.zone_name_ref() = std::move(zoneName);
@@ -3224,6 +3357,7 @@ folly::Future> MetaClient::renameZone(std::string originalZoneNam
}
folly::Future> MetaClient::dropZone(std::string zoneName) {
+ memory::MemoryCheckOffGuard g;
cpp2::DropZoneReq req;
req.zone_name_ref() = std::move(zoneName);
@@ -3242,6 +3376,7 @@ folly::Future> MetaClient::dropZone(std::string zoneName) {
folly::Future> MetaClient::addHostsIntoZone(std::vector hosts,
std::string zoneName,
bool isNew) {
+ memory::MemoryCheckOffGuard g;
cpp2::AddHostsIntoZoneReq req;
req.hosts_ref() = hosts;
req.zone_name_ref() = zoneName;
@@ -3260,6 +3395,7 @@ folly::Future> MetaClient::addHostsIntoZone(std::vector
}
folly::Future>> MetaClient::getZone(std::string zoneName) {
+ memory::MemoryCheckOffGuard g;
cpp2::GetZoneReq req;
req.zone_name_ref() = std::move(zoneName);
@@ -3274,6 +3410,7 @@ folly::Future>> MetaClient::getZone(std::string z
}
folly::Future>> MetaClient::listZones() {
+ memory::MemoryCheckOffGuard g;
cpp2::ListZonesReq req;
folly::Promise>> promise;
auto future = promise.getFuture();
@@ -3286,6 +3423,7 @@ folly::Future>> MetaClient::listZones() {
}
folly::Future> MetaClient::getStats(GraphSpaceID spaceId) {
+ memory::MemoryCheckOffGuard g;
cpp2::GetStatsReq req;
req.space_id_ref() = (spaceId);
folly::Promise> promise;
@@ -3305,6 +3443,7 @@ folly::Future> MetaClient::reportTaskFinish(
int32_t taskId,
nebula::cpp2::ErrorCode taskErrCode,
cpp2::StatsItem* statisticItem) {
+ memory::MemoryCheckOffGuard g;
cpp2::ReportTaskReq req;
req.code_ref() = taskErrCode;
req.space_id_ref() = spaceId;
@@ -3326,6 +3465,7 @@ folly::Future> MetaClient::reportTaskFinish(
folly::Future