From 75d15bcabd06d55e46f58c51476ed16ef61cfef6 Mon Sep 17 00:00:00 2001 From: yaohaolin Date: Thu, 30 Oct 2025 19:38:13 +0800 Subject: [PATCH] modify flags --- cli/deploy/conf/worker_config.json | 10 +++++----- cmake/package.cmake | 3 --- docs/source_zh_cn/appendix/dscli.md | 4 ++-- docs/source_zh_cn/appendix/log_guide.md | 14 +++++++++++++- .../datasystem/templates/worker_daemonset.yaml | 8 ++++---- k8s/helm_chart/datasystem/values.yaml | 2 +- python/setup.py | 2 +- setup.py | 2 +- src/datasystem/client/CMakeLists.txt | 2 -- .../common/kvstore/etcd/etcd_store.cpp | 8 ++++---- src/datasystem/common/log/logging.cpp | 4 ++-- .../common/log/spdlog/log_message_impl.cpp | 10 +++++----- .../hard_disk_exporter/hard_disk_exporter.cpp | 4 ++-- .../common/object_cache/CMakeLists.txt | 1 - .../common/rpc/rpc_auth_key_manager.cpp | 6 +++--- .../common/rpc/rpc_auth_key_manager_server.cpp | 6 +++--- .../common/rpc/zmq/zmq_server_impl.cpp | 4 ++-- .../master/object_cache/oc_metadata_manager.cpp | 4 ++-- .../cluster_manager/etcd_cluster_manager.cpp | 6 +++--- .../service/worker_oc_service_expire_impl.cpp | 4 ++-- .../service/worker_oc_service_get_impl.cpp | 8 ++++---- .../object_cache/worker_oc_service_impl.cpp | 2 +- src/datasystem/worker/worker_main.cpp | 8 ++++---- src/datasystem/worker/worker_oc_server.cpp | 14 +++++++------- src/datasystem/worker/worker_service_impl.cpp | 2 +- .../kv_cache/kv_cache_client_expire_test.cpp | 2 +- .../client/kv_cache/kv_client_cross_az_test.cpp | 16 ++++++++-------- .../client/kv_cache/kv_client_etcd_dfx_test.cpp | 4 ++-- .../client/kv_cache/kv_client_replica_test.cpp | 2 +- .../st/client/kv_cache/kv_client_scale_test.cpp | 4 ++-- .../object_cache/object_client_scale_test.cpp | 2 +- .../oc_client_plaintext_zmq_curve_test.cpp | 2 +- tests/st/cluster/external_cluster.cpp | 6 +++--- tests/st/cluster/external_cluster.h | 2 +- tests/st/common/kvstore/etcd_store_test.cpp | 4 ++-- tests/st/common/rpc/zmq/zmq_test.cpp | 2 +- .../object_cache/oc_giveup_primary_test.cpp | 10 +++++----- .../oc_migrate_metadata_manager_test.cpp | 10 +++++----- tests/ut/common.h | 8 ++++++++ .../common/shared_memory/mmap/mem_mmap_test.cpp | 6 ++++++ .../shared_memory/shared_disk_detecter_test.cpp | 9 +++++++++ .../object_cache/expired_object_manager_test.cpp | 2 +- .../oc_notify_worker_manager_test.cpp | 2 +- 43 files changed, 130 insertions(+), 101 deletions(-) diff --git a/cli/deploy/conf/worker_config.json b/cli/deploy/conf/worker_config.json index 5508300..3d41f98 100644 --- a/cli/deploy/conf/worker_config.json +++ b/cli/deploy/conf/worker_config.json @@ -31,9 +31,9 @@ "value": "./datasystem/uds", "description": "The directory to store unix domain socket file. The UDS generates temporary files in this path. Max length: 80" }, - "etcd_table_prefix": { + "az_name": { "value": "", - "description": "Prefix of all tables in etcd, which is used to distinguish tables created by different data systems in etcd, the value should contain english alphabetics(a-zA-Z), numbers (0-9) only." + "description": "az_name is typically used in scenarios where multiple AZ datasystem share a single etcd cluster, allowing different clusters to be distinguished by the az_name." }, "other_az_names": { "value": "", @@ -159,7 +159,7 @@ "value": "true", "description": "Deprecated: This flag is deprecated and will be removed in future releases." }, - "backend_store_dir": { + "rocksdb_store_dir": { "value": "./datasystem/rocksdb", "description": "Config MASTER back store directory and must specify in rocksdb scenario. The rocksdb database is used to persistently store the metadata stored in the master so that the metadata before the restart can be re-obtained when the master restarts." }, @@ -335,9 +335,9 @@ "value": "0", "description": "Vlog level, a larger value indicates more detailed logs. The value is between 0-3." }, - "enable_component_auth": { + "enable_curve_zmq": { "value": "false", - "description": "Whether to enable the authentication function between components(worker, master)." + "description": "Whether to enable Curve ZMQ for authentication and authorization between components." }, "zmq_server_io_context": { "value": "5", diff --git a/cmake/package.cmake b/cmake/package.cmake index f3f7f6a..72fadc1 100644 --- a/cmake/package.cmake +++ b/cmake/package.cmake @@ -74,7 +74,6 @@ set(SDK_USER_LIB_PATTERNS ${SDK_SPDLOG_LIB} "${SecureC_LIB_PATH}/libsecurec.so" "${TBB_LIB_PATH}/libtbb.so*" - "${CURL_LIB_PATH}/libcurl.so*" "${gRPC_LIB_PATH}/libgrpc.so*" "${gRPC_LIB_PATH}/libgrpc++.so*" "${gRPC_LIB_PATH}/libgpr.so*" @@ -111,7 +110,6 @@ if (BUILD_PYTHON_API) ${SDK_PROTOBUF_LIB} "${SecureC_LIB_PATH}/libsecurec.so" "${TBB_LIB_PATH}/libtbb.so*" - "${CURL_LIB_PATH}/libcurl.so*" "${OpenSSL_LIB_PATH}/libssl.so*" ${RPC_LIB_PATH} ) @@ -156,7 +154,6 @@ if (BUILD_GO_API) "${TBB_LIB_PATH}/libtbb.so*" "${OpenSSL_LIB_PATH}/libssl.so*" "${OpenSSL_LIB_PATH}/libcrypto.so*" - "${CURL_LIB_PATH}/libcurl.so*" "${gRPC_LIB_PATH}/libgrpc.so*" "${gRPC_LIB_PATH}/libgrpc++.so*" "${gRPC_LIB_PATH}/libgpr.so*" diff --git a/docs/source_zh_cn/appendix/dscli.md b/docs/source_zh_cn/appendix/dscli.md index 4eae317..38215ec 100644 --- a/docs/source_zh_cn/appendix/dscli.md +++ b/docs/source_zh_cn/appendix/dscli.md @@ -649,7 +649,7 @@ dscli collect_log --cluster_config_path ./cluster_config.json | ipc_through_shared_memory | bool | `true` | datasystem-worker共享内存启用开关 | | unix_domain_socket_dir | string | `"./yr_datasystem/uds"` | Unix Domain Socket (UDS) 文件存储目录配置,UDS文件该在该路径下产生,路径最大长度不能超过80个字符。该目录会被自动挂载到宿主机同名目录上,请确保容器具备宿主机同名目录的操作权限 | | worker_address | string | `"127.0.0.1:31501"` | datasystem_worker IP地址 | -| enable_component_auth | bool | `false` | 是否开启服务端组件间认证鉴权功能 | +| enable_curve_zmq | bool | `false` | 是否开启服务端组件间认证鉴权功能 | | curve_key_dir | string | `""` | 用于查找 ZMQ Curve 密钥文件的目录,启用 ZMQ 认证时必须指定该路径 | | oc_worker_worker_direct_port | int | `0` | 对象/KV缓存datasystem-worker之间用于数据传输的TCP通道,0表示禁用该功能;当指定为一个非0值时,datasystem-worker将会建立一条单独用于数据传输的TCP通道,用于加速节点间数据的传输速度,降低数据传输时延 | | oc_worker_worker_pool_size | int | `3` | datasystem-worker间用于数据传输的并行连接数,用于提升节点间数据传输的吞吐量,只有当 `ocWorkerWorkerDirectPort` 指定为非0值时该配置才生效 | @@ -731,7 +731,7 @@ dscli collect_log --cluster_config_path ./cluster_config.json | 配置项 | 类型 | 默认值 | 描述 | |-----|------|---------|-------------| -| backend_store_dir | string | `"./yr_datasystem/rocksdb"` | 配置元数据持久化目录,元数据通过RocksDB持久化在磁盘中 | +| rocksdb_store_dir | string | `"./yr_datasystem/rocksdb"` | 配置元数据持久化目录,元数据通过RocksDB持久化在磁盘中 | | rocksdb_background_threads | int | `16` | RocksDB的后台线程数,用于元数据的刷盘和压缩 | | rocksdb_max_open_file | int | `128` | RocksDB可使用的最大打开文件个数 | diff --git a/docs/source_zh_cn/appendix/log_guide.md b/docs/source_zh_cn/appendix/log_guide.md index 3236e55..8e57579 100644 --- a/docs/source_zh_cn/appendix/log_guide.md +++ b/docs/source_zh_cn/appendix/log_guide.md @@ -51,7 +51,19 @@ openYuanrong datasystem 不同模块日志分类如下表所示: | datasize | 16 | 记录Publish请求接收到的Payload大小。 | | request param | 2560 | 记录该请求的关键请求参数,最大长度2048。请参考“关键请求参数”表格。 | | response param | 1024 | 记录该请求的响应信息。最大长度为1024 Byte,超出则截断。 | -| shm_info | 47 | 记录共享内存使用信息,单位为Byte,按照1T限制大小,每个长度 13 Byte,格式为:memoryUsage/physicalMemoryUsage/totalLimit/rate
1) memoryUsage 已分配的内存大小,是已缓存的对象大小总和。
2) physicalMemoryUsage 已分配的物理内存大小。
3) totalLimit 共享内存总大小。
4) Rate 共享内存使用率,memoryUsage/totalLimit, 保留3位有效数字,单位: %.
  spill_disk_info 47 记录Spill磁盘使用信息。单位为Byte,按照1T限制大小,每个长度 13 Byte,格式为:spaceUsage/physicalSpaceUsage/totalLimit/rate
5) spaceUsage 已使用的磁盘大小,是已Spill的对象大小总和。
6) physicalSpaceUsage 已使用的物理磁盘大小。
7) totalLimit Spill磁盘总大小。
8) Rate Spill磁盘使用率,spaceUsage /totalLimit, 保留3位有效数字,单位: %.
  client nums 5 记录已和worker成功建立连接的Client数。最大值为10000.
  object nums 9 记录worker已缓存对象数。按照1亿对象限制数量。
  object total datasize 13 记录worker已缓存对象的大小。按照1T限制大小,长度 13 Byte
  WorkerOcService threadpool 21 WorkerOcService threadpool使用信息,线程数限制最大128;格式为:idleNum/currentTotalNum/MaxThreadNum/waitingTaskNum/rate
9) idelNum 空闲线程数;
10) currentTotalNum 当前正在运行任务的线程数;
11) MaxThreadNum threadpool最大可申请的线程数;
12) waitingTaskNum 正在等待的任务数。
13) rate 线程利用率,currentTotalNum/ MaxThreadNum,单位:%,保留3位有效数字。
  WorkerWorkerOcService threadpool 21 threadpool使用信息
  MasterWokrerOcService threadpool 21 threadpool使用信息
  MasterOcService threadpool 21 threadpool使用信息
  write ETCD queue 15 队列使用信息
  ETCDrequest success rate 6 请求使用率,单位 %,保留3位有效数字
  OBSrequest success rate 6 请求使用率,单位 %,保留3位有效数字
  Master AsyncTask threadpool 21 threadpool使用信息,格式为:idleNum/currentTotalNum/MaxThreadNum/waitingTaskNum/rate | +| shm_info | 47 | 记录共享内存使用信息,单位为Byte,按照1T限制大小,每个长度 13 Byte,格式为:memoryUsage/physicalMemoryUsage/totalLimit/rate
1) memoryUsage 已分配的内存大小,是已缓存的对象大小总和。
2) physicalMemoryUsage 已分配的物理内存大小。
3) totalLimit 共享内存总大小。
4) Rate 共享内存使用率,memoryUsage/totalLimit, 保留3位有效数字,单位: %. | +| spill_disk_inf0 | 47 | 记录Spill磁盘使用信息。单位为Byte,按照1T限制大小,每个长度 13 Byte,格式为:spaceUsage/physicalSpaceUsage/totalLimit/rate
1) spaceUsage 已使用的磁盘大小,是已Spill的对象大小总和。
2) physicalSpaceUsage 已使用的物理磁盘大小。
3) totalLimit Spill磁盘总大小。
4) Rate Spill磁盘使用率,spaceUsage /totalLimit, 保留3位有效数字,单位: %. | +| client nums | 5 | 记录已和worker成功建立连接的Client数。最大值为10000. | +| object nums | 9 | 记录worker已缓存对象数。按照1亿对象限制数量。 | +| object total datasize | 13 | 记录worker已缓存对象的大小。按照1T限制大小,长度 13 Byte | +| WorkerOcService threadpool | 21 | WorkerOcService threadpool使用信息,线程数限制最大128;格式为:idleNum/currentTotalNum/MaxThreadNum/waitingTaskNum/rate
1) idelNum 空闲线程数;
2) currentTotalNum 当前正在运行任务的线程数;
3) MaxThreadNum threadpool最大可申请的线程数;
4) waitingTaskNum 正在等待的任务数。
5) rate 线程利用率,currentTotalNum/ MaxThreadNum,单位:%,保留3位有效数字。 | +| WorkerWorkerOcService threadpool | 21 | threadpool使用信息 | +| MasterWokrerOcService threadpool | 21 | threadpool使用信息 | +| MasterOcService threadpool | 21 | threadpool使用信息 | +| write ETCD queue | 15 | 队列使用信息 | +| ETCDrequest success rate | 6 | 请求使用率,单位 %,保留3位有效数字 | +| OBSrequest success rate | 6 | 请求使用率,单位 %,保留3位有效数字 | +| Master AsyncTask threadpool | 21 | threadpool使用信息,格式为:idleNum/currentTotalNum/MaxThreadNum/waitingTaskNum/rate | #### SDK与worker访问日志关键请求参数 diff --git a/k8s/helm_chart/datasystem/templates/worker_daemonset.yaml b/k8s/helm_chart/datasystem/templates/worker_daemonset.yaml index d16edef..cba2d34 100644 --- a/k8s/helm_chart/datasystem/templates/worker_daemonset.yaml +++ b/k8s/helm_chart/datasystem/templates/worker_daemonset.yaml @@ -132,7 +132,7 @@ spec: - -l2_cache_delete_thread_num={{ $.Values.global.l2Cache.l2CacheDeleteThreadNum }} - -object_del_retry_delay_sec={{ $.Values.global.l2Cache.objectDelRetryDelaySec }} - -max_rpc_session_num={{ $.Values.global.rpc.maxRpcSessionNum }} - - -backend_store_dir=/home/sn/datasystem/rocksdb + - -rocksdb_store_dir=/home/sn/datasystem/rocksdb - -rocksdb_max_open_file={{ $.Values.global.metadata.rocksdbMaxOpenFile }} - -rocksdb_background_threads={{ $.Values.global.metadata.rocksdbBackgroundThreads }} - -node_timeout_s={{ $.Values.global.reliability.nodeTimeoutS }} @@ -154,14 +154,14 @@ spec: - -spill_file_open_limit={{ $.Values.global.spill.spillFileOpenLimit }} - -spill_enable_readahead={{ $.Values.global.spill.spillEnableReadahead }} - -data_migrate_rate_limit_mb={{ $.Values.global.gracefulShutdown.dataMigrateRateLimitMb }} - - -enable_component_auth={{ $.Values.global.rpc.enableCurveZmq }} + - -enable_curve_zmq={{ $.Values.global.rpc.enableCurveZmq }} - -ipc_through_shared_memory={{ $.Values.global.ipc.ipcThroughSharedMemory }} - -curve_key_dir=$(CURVE_KEY_DIR) - -zmq_server_io_context={{ $.Values.global.rpc.zmqServerIoContext }} - -zmq_client_io_context={{ $.Values.global.rpc.zmqClientIoContext }} - -zmq_chunk_sz={{ $.Values.global.rpc.zmqChunkSz | int64 }} - -etcd_address={{ $.Values.global.etcd.etcdAddress }} - - -etcd_table_prefix={{ $.Values.global.azName }} + - -az_name={{ $.Values.global.azName }} - -other_az_names={{ $.Values.global.crossAz.otherAzNames }} - -async_delete={{ $.Values.global.performance.asyncDelete}} - -etcd_meta_pool_size={{ $.Values.global.etcd.etcdMetaPoolSize }} @@ -253,7 +253,7 @@ spec: value: "{{ $spec.workerResources.sharedMemory }}" - name: CURVE_KEY_DIR value: {{ $.Values.global.rpc.curveKeyDir }} - - name: ENABLE_COMPONENT_AUTH + - name: ENABLE_CURVE_ZMQ value: "{{ $.Values.global.rpc.enableCurveZmq }}" - name: ETCD_CERT_DIR value: {{ $.Values.global.etcd.etcdCertDir }} diff --git a/k8s/helm_chart/datasystem/values.yaml b/k8s/helm_chart/datasystem/values.yaml index 0da7197..ac6c2f1 100644 --- a/k8s/helm_chart/datasystem/values.yaml +++ b/k8s/helm_chart/datasystem/values.yaml @@ -7,7 +7,7 @@ global: imageRegistry: "" images: # Image name and tag in 'name:tag' format - datasystem: "yr_datasystem:v0.1" + datasystem: "openyuanrong_datasystem:0.5.0" # Config ETCD table prefix, the value should only contain english alphabetics (a-zA-Z), numbers (0-9) only. azName: "AZ1" diff --git a/python/setup.py b/python/setup.py index 9d95ef4..02a3df9 100644 --- a/python/setup.py +++ b/python/setup.py @@ -87,7 +87,7 @@ def get_all_dependencies(): """ get all dependencies for datasystem """ - all_dependencies = {"libdatasystem.so", "libds_client_py.so"} + all_dependencies = {"libdatasystem.so", "libds_client_py.so", "libacl_plugin.so"} src = os.path.join(os.path.dirname(__file__), 'datasystem', 'lib') src_path = Path(src) for item in src_path.rglob('*'): diff --git a/setup.py b/setup.py index b3c0563..dd68f0b 100644 --- a/setup.py +++ b/setup.py @@ -90,7 +90,7 @@ def get_all_dependencies(): """ get all dependencies for datasystem """ - all_dependencies = {"libdatasystem.so", "libds_client_py.so"} + all_dependencies = {"libdatasystem.so", "libds_client_py.so", "libacl_plugin.so"} src = os.path.join(os.path.dirname(__file__), 'datasystem', 'lib') worker = os.path.join(os.path.dirname(__file__), 'datasystem', 'datasystem_worker') src_path = Path(src) diff --git a/src/datasystem/client/CMakeLists.txt b/src/datasystem/client/CMakeLists.txt index e15543e..9b871b4 100644 --- a/src/datasystem/client/CMakeLists.txt +++ b/src/datasystem/client/CMakeLists.txt @@ -23,7 +23,6 @@ list(APPEND CLIENT_SRCS list(APPEND CLIENT_DEPEND_LIBS ${SECUREC_LIBRARY} ${TBB_LIBRARY} - CURL::libcurl protobuf::libprotobuf ak_sk_signature common_buffer @@ -34,7 +33,6 @@ list(APPEND CLIENT_DEPEND_LIBS common_shm_unit_info common_util common_immutable_string - httpclient nlohmann_json::nlohmann_json posix_protos_client share_memory_protos_client diff --git a/src/datasystem/common/kvstore/etcd/etcd_store.cpp b/src/datasystem/common/kvstore/etcd/etcd_store.cpp index a3d6f38..805cd80 100644 --- a/src/datasystem/common/kvstore/etcd/etcd_store.cpp +++ b/src/datasystem/common/kvstore/etcd/etcd_store.cpp @@ -39,7 +39,6 @@ #include "datasystem/common/util/net_util.h" #include "datasystem/utils/status.h" -DS_DECLARE_string(etcd_table_prefix); DS_DEFINE_string(etcd_address, "", "Address of ETCD server"); DS_DEFINE_validator(etcd_address, &Validator::ValidateEtcdAddresses); DS_DEFINE_string(other_az_names, "", "Specify other az names using the same etcd. Split by ','"); @@ -47,6 +46,7 @@ DS_DEFINE_validator(other_az_names, &Validator::ValidateOtherAzNames); DS_DECLARE_uint32(node_timeout_s); DS_DECLARE_uint32(node_dead_timeout_s); DS_DECLARE_bool(auto_del_dead_node); +DS_DECLARE_string(az_name); namespace datasystem { EtcdStore::EtcdStore(const std::string &address) : address_(address) @@ -156,15 +156,15 @@ Status EtcdStore::CreateTable(const std::string &tableName, const std::string &t std::lock_guard lck(mutex_); CHECK_FAIL_RETURN_STATUS(tableMap_.find(tableName) == tableMap_.end(), K_DUPLICATED, "The table already exists. tableName:" + tableName); - if (!FLAGS_etcd_table_prefix.empty()) { - tableMap_.emplace(tableName, "/" + FLAGS_etcd_table_prefix + tablePrefix); + if (!FLAGS_az_name.empty()) { + tableMap_.emplace(tableName, "/" + FLAGS_az_name + tablePrefix); } else { tableMap_.emplace(tableName, tablePrefix); } if (!FLAGS_other_az_names.empty()) { for (auto &azName : Split(FLAGS_other_az_names, ",")) { - if (azName != FLAGS_etcd_table_prefix) { + if (azName != FLAGS_az_name) { std::lock_guard lck(otherAzTblMutex_); otherAzTableMap_[tableName].emplace_back("/" + azName + tablePrefix); } diff --git a/src/datasystem/common/log/logging.cpp b/src/datasystem/common/log/logging.cpp index b2a64c6..3771b72 100644 --- a/src/datasystem/common/log/logging.cpp +++ b/src/datasystem/common/log/logging.cpp @@ -89,7 +89,7 @@ DS_DEFINE_uint32(log_async_queue_size, DEFAULT_LOG_ASYNC_QUEUE_SIZE, "Size of as DS_DEFINE_validator(log_filename, &Validator::ValidateEligibleChar); DS_DECLARE_bool(log_monitor); -DS_DECLARE_string(etcd_table_prefix); +DS_DECLARE_string(az_name); using namespace std::chrono; @@ -369,7 +369,7 @@ Status Logging::WriteLogToFile(int lineOfCode, const std::string &fileNameOfCode auto pos = fileNameOfCode.find_last_of('/'); std::string name = pos == std::string::npos ? fileNameOfCode : fileNameOfCode.substr(pos + 1); ConstructLogPrefix(ss, logTime.getTm(), logTime.getUsec(), name.c_str(), lineOfCode, podName_.c_str(), level, - FLAGS_etcd_table_prefix); + FLAGS_az_name); ss << message; if (message.empty() || message[message.size() - 1] != '\n') { ss << '\n'; diff --git a/src/datasystem/common/log/spdlog/log_message_impl.cpp b/src/datasystem/common/log/spdlog/log_message_impl.cpp index 9d125f2..bdb258e 100644 --- a/src/datasystem/common/log/spdlog/log_message_impl.cpp +++ b/src/datasystem/common/log/spdlog/log_message_impl.cpp @@ -35,9 +35,9 @@ #include "datasystem/common/log/trace.h" DS_DEFINE_int32(v, 0, "Show all VLOG(m) messages for m <= this."); -DS_DEFINE_string( - etcd_table_prefix, "", - "Prefix of all tables in etcd, which is used to distinguish tables created by different data systems in etcd."); +DS_DEFINE_string(az_name, "", + "az_name is typically used in scenarios where multiple AZ datasystem share a single etcd cluster, " + "allowing different clusters to be distinguished by the az_name."); namespace datasystem { // thread_local for store log info @@ -72,7 +72,7 @@ static void AppendLogMessageImplPrefix(const std::string &podName, std::ostream static thread_local pid_t tid = syscall(__NR_gettid); logStream << podName << " | " << pid << ":" << tid << " | " << Trace::Instance().GetTraceID() << " | " - << FLAGS_etcd_table_prefix << " | "; + << FLAGS_az_name << " | "; } static DsLogger GetMessageLogger() @@ -142,7 +142,7 @@ void LogMessageImpl::ToStderr() } ConstructLogPrefix(std::cerr, logTime.getTm(), logTime.getUsec(), baseFilename, sourceLoc_.line, podName_.c_str(), - LogSeverityName[0], FLAGS_etcd_table_prefix); + LogSeverityName[0], FLAGS_az_name); std::cerr.write(g_ThreadLogData, static_cast(msgSize_)); std::cerr << '\n'; diff --git a/src/datasystem/common/metrics/hard_disk_exporter/hard_disk_exporter.cpp b/src/datasystem/common/metrics/hard_disk_exporter/hard_disk_exporter.cpp index cb5e047..ea30dc7 100644 --- a/src/datasystem/common/metrics/hard_disk_exporter/hard_disk_exporter.cpp +++ b/src/datasystem/common/metrics/hard_disk_exporter/hard_disk_exporter.cpp @@ -29,7 +29,7 @@ #include "datasystem/common/util/uri.h" #include "datasystem/common/log/log_time.h" -DS_DECLARE_string(etcd_table_prefix); +DS_DECLARE_string(az_name); DS_DECLARE_string(log_dir); DS_DECLARE_int32(logfile_mode); DS_DECLARE_uint32(log_size); @@ -52,7 +52,7 @@ void HardDiskExporter::Send(const std::string &message, Uri &uri, int line) std::ostringstream constructStr; LogTime logTime; ConstructLogPrefix(constructStr, logTime.getTm(), logTime.getUsec(), uri.GetFileName().c_str(), line, podName_, - 'I', FLAGS_etcd_table_prefix); + 'I', FLAGS_az_name); constructStr << std::string(message); WriteMessage(constructStr.str()); } diff --git a/src/datasystem/common/object_cache/CMakeLists.txt b/src/datasystem/common/object_cache/CMakeLists.txt index 5c2167d..8406e02 100644 --- a/src/datasystem/common/object_cache/CMakeLists.txt +++ b/src/datasystem/common/object_cache/CMakeLists.txt @@ -10,7 +10,6 @@ set(COMMON_BUFFER_DEPEND_LIBS ${CLIENT_LIB} common_log common_util - CURL::libcurl ) set(COMMON_REF_SRCS object_ref_info.cpp) diff --git a/src/datasystem/common/rpc/rpc_auth_key_manager.cpp b/src/datasystem/common/rpc/rpc_auth_key_manager.cpp index b3c3cdd..ba6330a 100644 --- a/src/datasystem/common/rpc/rpc_auth_key_manager.cpp +++ b/src/datasystem/common/rpc/rpc_auth_key_manager.cpp @@ -22,8 +22,8 @@ #include #include -DS_DEFINE_bool(enable_component_auth, false, - "Enable all of datasystem components authentication, default is false"); +DS_DEFINE_bool(enable_curve_zmq, false, + "Whether to enable Curve ZMQ for authentication and authorization between components."); namespace datasystem { static Status CreateCredentialsHelper(const RpcAuthKeys &keys, const std::string &serverName, RpcCredential &cred) @@ -41,7 +41,7 @@ static Status CreateCredentialsHelper(const RpcAuthKeys &keys, const std::string Status RpcAuthKeyManager::CreateCredentials(const std::string &serverName, RpcCredential &cred) { - if (!FLAGS_enable_component_auth) { + if (!FLAGS_enable_curve_zmq) { return Status::OK(); } const RpcAuthKeys &authKeys = RpcAuthKeyManager::Instance().GetKeys(); diff --git a/src/datasystem/common/rpc/rpc_auth_key_manager_server.cpp b/src/datasystem/common/rpc/rpc_auth_key_manager_server.cpp index 3a0c7b2..c2c1afd 100644 --- a/src/datasystem/common/rpc/rpc_auth_key_manager_server.cpp +++ b/src/datasystem/common/rpc/rpc_auth_key_manager_server.cpp @@ -28,7 +28,7 @@ #include "datasystem/common/util/strings_util.h" #include "datasystem/common/util/validator.h" -DS_DECLARE_bool(enable_component_auth); +DS_DECLARE_bool(enable_curve_zmq); DS_DEFINE_string(curve_key_dir, "", "The directory to find ZMQ curve key files. This path must be specified " "when zmq authentication is enabled. Path must be less than 4095 characters (PATH_MAX)."); @@ -62,7 +62,7 @@ static Status LoadKey(const std::string &filePath, std::unique_ptr &keyC ifs.close(); std::string keyString = buffer.str(); Raii clearRaii([&keyString]() { ClearStr(keyString); }); - if (FLAGS_enable_component_auth) { + if (FLAGS_enable_curve_zmq) { // Decrypt ciphertext once. int keyContentSize; RETURN_IF_NOT_OK_PRINT_ERROR_MSG(SecretManager::Instance()->Decrypt(keyString, keyContent, keyContentSize), @@ -158,7 +158,7 @@ static Status LoadServerKeysHelper(const std::string &serverName) Status RpcAuthKeyManager::ServerLoadKeys(const std::string &serverName, RpcCredential &cred) { - if (!FLAGS_enable_component_auth) { + if (!FLAGS_enable_curve_zmq) { return Status::OK(); } CHECK_FAIL_RETURN_STATUS_PRINT_ERROR(SERVER_TYPES.find(serverName) != SERVER_TYPES.end(), K_INVALID, diff --git a/src/datasystem/common/rpc/zmq/zmq_server_impl.cpp b/src/datasystem/common/rpc/zmq/zmq_server_impl.cpp index 9d13dd7..f4e097a 100644 --- a/src/datasystem/common/rpc/zmq/zmq_server_impl.cpp +++ b/src/datasystem/common/rpc/zmq/zmq_server_impl.cpp @@ -39,7 +39,7 @@ DS_DEFINE_int32(zmq_server_io_context, 5, "Optimize the performance of the customer. Default server 5. " "The higher the throughput, the higher the value, but should be in range [1, 32]"); -DS_DECLARE_bool(enable_component_auth); +DS_DECLARE_bool(enable_curve_zmq); namespace { static bool ValidateZmqServerIoCtxThreads(const char *flagname, int32_t value) @@ -189,7 +189,7 @@ Status ZmqServerImpl::SendErrorToClient(const MetaPb &meta, const Status &status Status ZmqServerImpl::ClientToService(ZmqMsgFrames &&frames) { MetaPb meta; - ZmqCurveUserId userId = { .checkUserId_ = FLAGS_enable_component_auth }; + ZmqCurveUserId userId = { .checkUserId_ = FLAGS_enable_curve_zmq }; Status rc = ParseMsgFrames(frames, meta, ffd_, EventType::ZMQ, userId); if (rc.IsError()) { // Silently (no logging) ignore K_TRY_AGAIN because stub will probe us with an empty message diff --git a/src/datasystem/master/object_cache/oc_metadata_manager.cpp b/src/datasystem/master/object_cache/oc_metadata_manager.cpp index 39a5020..7fdb92e 100644 --- a/src/datasystem/master/object_cache/oc_metadata_manager.cpp +++ b/src/datasystem/master/object_cache/oc_metadata_manager.cpp @@ -69,11 +69,11 @@ #include "datasystem/worker/cluster_event_type.h" #include "datasystem/worker/hash_ring/hash_ring_event.h" -DS_DEFINE_string(backend_store_dir, "~/datasystem/rocksdb", +DS_DEFINE_string(rocksdb_store_dir, "~/datasystem/rocksdb", "The path of persistent gcs meta data and must " "specify in rocksdb scenario. The rocksdb database is used to persistently store the metadata " "in the master, so that the metadata before the restart can be re-obtained when the master restarts."); -DS_DEFINE_validator(backend_store_dir, &Validator::ValidatePathString); +DS_DEFINE_validator(rocksdb_store_dir, &Validator::ValidatePathString); DS_DECLARE_string(etcd_address); DS_DECLARE_bool(async_delete); diff --git a/src/datasystem/worker/cluster_manager/etcd_cluster_manager.cpp b/src/datasystem/worker/cluster_manager/etcd_cluster_manager.cpp index ac3c1fb..eadad6b 100644 --- a/src/datasystem/worker/cluster_manager/etcd_cluster_manager.cpp +++ b/src/datasystem/worker/cluster_manager/etcd_cluster_manager.cpp @@ -55,7 +55,7 @@ DS_DECLARE_uint32(node_dead_timeout_s); DS_DECLARE_uint32(add_node_wait_time_s); DS_DECLARE_string(master_address); DS_DECLARE_string(other_az_names); -DS_DECLARE_string(etcd_table_prefix); +DS_DECLARE_string(az_name); DS_DECLARE_bool(enable_distributed_master); DS_DECLARE_bool(auto_del_dead_node); DS_DEFINE_bool(cross_az_get_meta_from_worker, false, "cross az to get metadata from worker"); @@ -103,7 +103,7 @@ EtcdClusterManager::EtcdClusterManager(const HostPort &workerAddress, const Host if (!FLAGS_other_az_names.empty() && FLAGS_enable_distributed_master) { ConstructOtherAzHashRings(); for (const auto &azName : Split(FLAGS_other_az_names, ",")) { - if (azName != FLAGS_etcd_table_prefix) { + if (azName != FLAGS_az_name) { otherAZNames_.emplace_back(azName); } } @@ -135,7 +135,7 @@ EtcdClusterManager::~EtcdClusterManager() void EtcdClusterManager::ConstructOtherAzHashRings() { for (const auto &azName : Split(FLAGS_other_az_names, ",")) { - if (azName != FLAGS_etcd_table_prefix) { + if (azName != FLAGS_az_name) { auto readRing = std::make_unique(azName, workerAddress_.ToString(), etcdDB_); (void)otherAzHashRings_.insert(std::make_pair(azName, std::move(readRing))); } diff --git a/src/datasystem/worker/object_cache/service/worker_oc_service_expire_impl.cpp b/src/datasystem/worker/object_cache/service/worker_oc_service_expire_impl.cpp index 785e82a..f4d0709 100644 --- a/src/datasystem/worker/object_cache/service/worker_oc_service_expire_impl.cpp +++ b/src/datasystem/worker/object_cache/service/worker_oc_service_expire_impl.cpp @@ -35,7 +35,7 @@ #include "datasystem/worker/authenticate.h" DS_DECLARE_string(other_az_names); -DS_DECLARE_string(etcd_table_prefix); +DS_DECLARE_string(az_name); DS_DECLARE_bool(cross_az_get_data_from_worker); DS_DECLARE_bool(cross_az_get_meta_from_worker); @@ -48,7 +48,7 @@ WorkerOcServiceExpireImpl::WorkerOcServiceExpireImpl(WorkerOcServiceCrudParam &i : WorkerOcServiceCrudCommonApi(initParam), etcdCM_(etcdCM), akSkManager_(std::move(akSkManager)) { for (const auto &azName : Split(FLAGS_other_az_names, ",")) { - if (azName != FLAGS_etcd_table_prefix) { + if (azName != FLAGS_az_name) { otherAZNames_.emplace_back(azName); } } diff --git a/src/datasystem/worker/object_cache/service/worker_oc_service_get_impl.cpp b/src/datasystem/worker/object_cache/service/worker_oc_service_get_impl.cpp index 8595ff3..50ecb62 100644 --- a/src/datasystem/worker/object_cache/service/worker_oc_service_get_impl.cpp +++ b/src/datasystem/worker/object_cache/service/worker_oc_service_get_impl.cpp @@ -52,7 +52,7 @@ #include "datasystem/worker/object_cache/worker_worker_oc_api.h" DS_DECLARE_string(other_az_names); -DS_DECLARE_string(etcd_table_prefix); +DS_DECLARE_string(az_name); DS_DECLARE_bool(cross_az_get_data_from_worker); DS_DECLARE_bool(cross_az_get_meta_from_worker); DS_DECLARE_bool(oc_io_from_l2cache_need_metadata); @@ -79,7 +79,7 @@ WorkerOcServiceGetImpl::WorkerOcServiceGetImpl(WorkerOcServiceCrudParam &initPar { if (HaveOtherAZ()) { for (const auto &azName : Split(FLAGS_other_az_names, ",")) { - if (azName != FLAGS_etcd_table_prefix) { + if (azName != FLAGS_az_name) { otherAZNames_.emplace_back(azName); } } @@ -1346,7 +1346,7 @@ Status WorkerOcServiceGetImpl::QueryMetaDataFromEtcd(const std::unordered_setfirst, std::string(ETCD_RING_PREFIX) + "/").erase(0, 1); - if (!FLAGS_etcd_table_prefix.empty() && azName != FLAGS_etcd_table_prefix) { + if (!FLAGS_az_name.empty() && azName != FLAGS_az_name) { clusterInfo.otherAzHashrings.emplace_back(std::move(azName), std::move(itr->second)); } else { clusterInfo.localHashRing.emplace_back(std::move(*itr)); @@ -551,7 +551,7 @@ Status WorkerOCServer::LoadWorkersFromRocksDb(ClusterInfo &clusterInfo, auto workerAddr = GetSubStringAfterField(itr->first, std::string(ETCD_CLUSTER_TABLE) + "/"); CHECK_FAIL_RETURN_STATUS(!workerAddr.empty(), K_RUNTIME_ERROR, "The loaded cluster information is incomplete"); auto azName = GetSubStringBeforeField(itr->first, "/" + std::string(ETCD_CLUSTER_TABLE) + "/").erase(0, 1); - if (!FLAGS_etcd_table_prefix.empty() && azName != FLAGS_etcd_table_prefix) { + if (!FLAGS_az_name.empty() && azName != FLAGS_az_name) { clusterInfo.otherAzWorkers.emplace_back(std::move(workerAddr), std::move(itr->second)); } else { if (workerAddr != hostPort_.ToString()) { @@ -719,7 +719,7 @@ Status WorkerOCServer::InitLivenessCheck() Status WorkerOCServer::InitReplicaManager() { ReplicaManagerParam param; - param.dbRootPath = FLAGS_backend_store_dir; + param.dbRootPath = FLAGS_rocksdb_store_dir; param.currWorkerId = etcdCM_->GetLocalWorkerUuid(); param.akSkManager = akSkManager_; param.etcdStore = etcdStore_.get(); diff --git a/src/datasystem/worker/worker_service_impl.cpp b/src/datasystem/worker/worker_service_impl.cpp index 685c783..0c1d10f 100644 --- a/src/datasystem/worker/worker_service_impl.cpp +++ b/src/datasystem/worker/worker_service_impl.cpp @@ -62,7 +62,7 @@ DS_DEFINE_uint32(max_client_num, 200, "Maximum number of clients that can be connected to a worker. Value range: [1, 10000]"); DS_DEFINE_validator(max_client_num, &Validator::ValidateClientNum); DS_DECLARE_uint32(node_timeout_s); -DS_DECLARE_string(etcd_table_prefix); +DS_DECLARE_string(az_name); DS_DECLARE_uint64(client_dead_timeout_s); DS_DECLARE_bool(enable_huge_tlb); DS_DEFINE_uint64(oc_shm_transfer_threshold_kb, 500u, diff --git a/tests/st/client/kv_cache/kv_cache_client_expire_test.cpp b/tests/st/client/kv_cache/kv_cache_client_expire_test.cpp index 732a3ce..de710ec 100644 --- a/tests/st/client/kv_cache/kv_cache_client_expire_test.cpp +++ b/tests/st/client/kv_cache/kv_cache_client_expire_test.cpp @@ -225,7 +225,7 @@ void SetClusterSetupOptions(ExternalClusterOptions &opts) override "-cross_az_get_meta_from_worker=true -cross_az_get_data_from_worker=true", timeoutS_, deadTimeoutS_); for (size_t i = 0; i < workerNum_; i++) { - std::string param = "-etcd_table_prefix=" + azNames_[i % azNames_.size()]; + std::string param = "-az_name=" + azNames_[i % azNames_.size()]; opts.workerSpecifyGflagParams[i] += param; } } diff --git a/tests/st/client/kv_cache/kv_client_cross_az_test.cpp b/tests/st/client/kv_cache/kv_client_cross_az_test.cpp index 04166d3..e57003b 100644 --- a/tests/st/client/kv_cache/kv_client_cross_az_test.cpp +++ b/tests/st/client/kv_cache/kv_client_cross_az_test.cpp @@ -80,7 +80,7 @@ public: opts.workerGflagParams = OBSGflag; for (size_t i = 0; i < workerNum_; i++) { - std::string param = "-etcd_table_prefix="; + std::string param = "-az_name="; if (i % MASTER_NUM == 0) { param.append(AZ1); } else { @@ -445,7 +445,7 @@ public: opts.workerGflagParams = obsGflag; for (size_t i = 0; i < DEFAULT_WORKER_NUM; i++) { - std::string param = "-etcd_table_prefix="; + std::string param = "-az_name="; if (i % MASTER_NUM == 0) { param.append(AZ1); } else { @@ -486,7 +486,7 @@ public: opts.workerConfigs.emplace_back(HOST_IP, GetFreePort()); workerAddress_.emplace_back(opts.workerConfigs.back().ToString()); - std::string param = "-etcd_table_prefix="; + std::string param = "-az_name="; if (i < EACH_AZ_WORKER_NUM) { param.append(AZ1); } else { @@ -1028,7 +1028,7 @@ public: for (size_t i = 0; i < workerNum_; i++) { opts.workerConfigs.emplace_back(HOST_IP, GetFreePort()); workerAddress_.emplace_back(opts.workerConfigs.back().ToString()); - std::string param = "-etcd_table_prefix="; + std::string param = "-az_name="; param.append(otherAzNames[i]); opts.workerSpecifyGflagParams[i] = param; } @@ -1162,8 +1162,8 @@ public: "-other_az_names=AZ1,AZ2 -cross_az_get_meta_from_worker=true -oc_io_from_l2cache_need_metadata=false -v=2"; opts.workerGflagParams = gflag; - opts.workerSpecifyGflagParams[0] += " -etcd_table_prefix=AZ1 "; - opts.workerSpecifyGflagParams[1] += " -etcd_table_prefix=AZ2 "; + opts.workerSpecifyGflagParams[0] += " -az_name=AZ1 "; + opts.workerSpecifyGflagParams[1] += " -az_name=AZ2 "; std::vector otherAzNames = { "AZ1", "AZ2" }; for (size_t i = 0; i < workerNum_; i++) { opts.workerConfigs.emplace_back(HOST_IP, GetFreePort()); @@ -1236,7 +1236,7 @@ public: for (size_t i = 0; i < workerNum_; i++) { opts.workerConfigs.emplace_back(HOST_IP, GetFreePort()); workerAddress_.emplace_back(opts.workerConfigs.back().ToString()); - std::string param = "-etcd_table_prefix="; + std::string param = "-az_name="; param.append(otherAzNames_[i % otherAzNames_.size()]); opts.workerSpecifyGflagParams[i] = param; } @@ -1490,7 +1490,7 @@ public: opts.workerGflagParams = gflag; for (size_t i = 0; i < workerNum_; i++) { auto azName = azNames_[i % azNames_.size()]; - std::string param = "-etcd_table_prefix=" + azName; + std::string param = "-az_name=" + azName; opts.workerSpecifyGflagParams[i] = param; } } diff --git a/tests/st/client/kv_cache/kv_client_etcd_dfx_test.cpp b/tests/st/client/kv_cache/kv_client_etcd_dfx_test.cpp index 5a44599..ea4f814 100644 --- a/tests/st/client/kv_cache/kv_client_etcd_dfx_test.cpp +++ b/tests/st/client/kv_cache/kv_client_etcd_dfx_test.cpp @@ -328,7 +328,7 @@ public: "-cross_az_get_meta_from_worker=true", timeoutS_, deadTimeoutS_); for (size_t i = 0; i < workerNum_; i++) { - std::string param = "-etcd_table_prefix=" + azNames_[i % azNames_.size()]; + std::string param = "-az_name=" + azNames_[i % azNames_.size()]; opts.workerSpecifyGflagParams[i] += param; } } @@ -375,7 +375,7 @@ public: "-cross_az_get_meta_from_worker=true", timeoutS_, deadTimeoutS_); for (size_t i = 0; i < workerNum_; i++) { - std::string param = "-etcd_table_prefix=" + azNames_[i % azNames_.size()]; + std::string param = "-az_name=" + azNames_[i % azNames_.size()]; opts.workerSpecifyGflagParams[i] += param; } } diff --git a/tests/st/client/kv_cache/kv_client_replica_test.cpp b/tests/st/client/kv_cache/kv_client_replica_test.cpp index c94f5af..d0bb2a9 100644 --- a/tests/st/client/kv_cache/kv_client_replica_test.cpp +++ b/tests/st/client/kv_cache/kv_client_replica_test.cpp @@ -814,7 +814,7 @@ public: for (size_t i = 0; i < WORKER_NUM; i++) { opts.workerConfigs.emplace_back("127.0.0.1", GetFreePort()); workerAddress_.emplace_back(opts.workerConfigs.back().ToString()); - std::string param = "-etcd_table_prefix="; + std::string param = "-az_name="; param.append(otherAzNames_[i % otherAzNames_.size()]); opts.workerSpecifyGflagParams[i] = param; } diff --git a/tests/st/client/kv_cache/kv_client_scale_test.cpp b/tests/st/client/kv_cache/kv_client_scale_test.cpp index a1b2ef1..635b567 100644 --- a/tests/st/client/kv_cache/kv_client_scale_test.cpp +++ b/tests/st/client/kv_cache/kv_client_scale_test.cpp @@ -41,7 +41,7 @@ DS_DECLARE_string(etcd_address); DS_DECLARE_string(master_address); -DS_DECLARE_string(etcd_table_prefix); +DS_DECLARE_string(az_name); namespace datasystem { namespace st { @@ -1507,7 +1507,7 @@ TEST_F(STCScaleDownTest, ShutdownWorkerAndDelKeyInEtcdTest) StartWorkerAndWaitReady({ 0 }); HostPort w0; DS_ASSERT_OK(cluster_->GetWorkerAddr(0, w0)); - std::string key = FLAGS_etcd_table_prefix + "/" + ETCD_CLUSTER_TABLE + "/" + w0.ToString(); + std::string key = FLAGS_az_name + "/" + ETCD_CLUSTER_TABLE + "/" + w0.ToString(); RangeSearchResult res; DS_ASSERT_OK(db_->RawGet(key, res)); DS_ASSERT_OK(externalCluster_->ShutdownNode(WORKER, 0)); diff --git a/tests/st/client/object_cache/object_client_scale_test.cpp b/tests/st/client/object_cache/object_client_scale_test.cpp index c4619c4..51e2c2b 100644 --- a/tests/st/client/object_cache/object_client_scale_test.cpp +++ b/tests/st/client/object_cache/object_client_scale_test.cpp @@ -55,7 +55,7 @@ DS_DECLARE_string(etcd_address); DS_DECLARE_string(master_address); -DS_DECLARE_string(etcd_table_prefix); +DS_DECLARE_string(az_name); DS_DECLARE_string(log_dir); namespace datasystem { diff --git a/tests/st/client/object_cache/oc_client_plaintext_zmq_curve_test.cpp b/tests/st/client/object_cache/oc_client_plaintext_zmq_curve_test.cpp index ff5b503..e3f099c 100644 --- a/tests/st/client/object_cache/oc_client_plaintext_zmq_curve_test.cpp +++ b/tests/st/client/object_cache/oc_client_plaintext_zmq_curve_test.cpp @@ -44,7 +44,7 @@ public: // use default configurations for all the other zmq curve gflags settings const std::string zmqConfig = - "-enable_component_auth=true -encrypt_kit=plaintext -curve_key_dir=" + GetCurveKeyDir(); + "-enable_curve_zmq=true -encrypt_kit=plaintext -curve_key_dir=" + GetCurveKeyDir(); opts.workerGflagParams = zmqConfig; FLAGS_v = 1; } diff --git a/tests/st/cluster/external_cluster.cpp b/tests/st/cluster/external_cluster.cpp index 1053b22..7125848 100644 --- a/tests/st/cluster/external_cluster.cpp +++ b/tests/st/cluster/external_cluster.cpp @@ -896,7 +896,7 @@ Status ExternalCluster::StartMaster(int index) std::string healthFile = rootDir + "/health"; (void)DeleteFile(healthFile); masterCmd += " -master_address=" + opts_.masterIpAddrs[index].ToString() + " -log_dir=" + rootDir + "/log" - + " -backend_store_dir=" + rootDir + "/rocksdb" + " -unix_domain_socket_dir=" + opts_.socketDir + " " + + " -rocksdb_store_dir=" + rootDir + "/rocksdb" + " -unix_domain_socket_dir=" + opts_.socketDir + " " + " -v=" + std::to_string(opts_.vLogLevel) + " -health_check_path=" + healthFile + +" -l2_cache_delete_thread_num=4 " + opts_.masterGflagParams + " -rpc_thread_num=" + std::to_string(opts_.numRpcThreads); @@ -910,7 +910,7 @@ Status ExternalCluster::StartMaster(int index) } etcdUrl += addrs.first.ToString(); } - masterCmd += " -backend_store=etcd -etcd_address=" + etcdUrl + " -etcd_table_prefix=" + opts_.etcdPrefix; + masterCmd += " -backend_store=etcd -etcd_address=" + etcdUrl + " -az_name=" + opts_.etcdPrefix; } LOG(INFO) << "Launch master [" << index << "] command: " << masterCmd; auto masterProcess = std::make_unique(masterCmd, opts_.masterIpAddrs[index]); @@ -1024,7 +1024,7 @@ Status ExternalCluster::StartWorker(int index, const HostPort &address, std::str cmd += " " + specifyParams[index]; } if (opts_.isObjectCache) { - cmd += " -backend_store_dir=" + rootDir + "/rocksdb "; + cmd += " -rocksdb_store_dir=" + rootDir + "/rocksdb "; } if (opts_.enableLivenessProbe) { cmd += " -liveness_check_path=" + rootDir + "/liveness "; diff --git a/tests/st/cluster/external_cluster.h b/tests/st/cluster/external_cluster.h index b2b3216..00f6083 100644 --- a/tests/st/cluster/external_cluster.h +++ b/tests/st/cluster/external_cluster.h @@ -35,7 +35,7 @@ #include "cluster/base_cluster.h" #include "cluster/subprocess.h" -DS_DECLARE_bool(enable_component_auth); +DS_DECLARE_bool(enable_curve_zmq); namespace datasystem { namespace st { diff --git a/tests/st/common/kvstore/etcd_store_test.cpp b/tests/st/common/kvstore/etcd_store_test.cpp index 8ce7e69..a08519d 100644 --- a/tests/st/common/kvstore/etcd_store_test.cpp +++ b/tests/st/common/kvstore/etcd_store_test.cpp @@ -45,7 +45,7 @@ using namespace datasystem; DS_DECLARE_string(etcd_address); -DS_DECLARE_string(etcd_table_prefix); +DS_DECLARE_string(az_name); DS_DECLARE_bool(enable_etcd_auth); DS_DECLARE_string(etcd_target_name_override); DS_DECLARE_string(encrypt_kit); @@ -848,7 +848,7 @@ TEST_F(EtcdStoreTest, TestGetEtcdPrefix) { LOG(INFO) << "Test EtcdStore GetEtcdPrefix"; std::string table_prefix = "AZ1"; - FLAGS_etcd_table_prefix = table_prefix; + FLAGS_az_name = table_prefix; InitTestEtcdInstance(); std::string prefix; DS_ASSERT_OK(db_->GetEtcdPrefix(tableName_, prefix)); diff --git a/tests/st/common/rpc/zmq/zmq_test.cpp b/tests/st/common/rpc/zmq/zmq_test.cpp index 7678c3d..e0c1ca8 100644 --- a/tests/st/common/rpc/zmq/zmq_test.cpp +++ b/tests/st/common/rpc/zmq/zmq_test.cpp @@ -43,7 +43,7 @@ #include "datasystem/common/util/status_helper.h" #include "datasystem/protos/zmq_test.stub.rpc.pb.h" -DS_DECLARE_bool(enable_component_auth); +DS_DECLARE_bool(enable_curve_zmq); DS_DECLARE_string(curve_key_dir); DS_DECLARE_bool(log_async); DS_DECLARE_string(unix_domain_socket_dir); diff --git a/tests/st/master/object_cache/oc_giveup_primary_test.cpp b/tests/st/master/object_cache/oc_giveup_primary_test.cpp index aea31f2..c1dd5c1 100644 --- a/tests/st/master/object_cache/oc_giveup_primary_test.cpp +++ b/tests/st/master/object_cache/oc_giveup_primary_test.cpp @@ -50,7 +50,7 @@ #include "datasystem/worker/object_cache/worker_master_oc_api.h" #include "gtest/gtest.h" -DS_DECLARE_string(backend_store_dir); +DS_DECLARE_string(rocksdb_store_dir); DS_DECLARE_string(etcd_address); DS_DECLARE_string(master_address); @@ -77,8 +77,8 @@ public: Status PreInitRocksDB() { RETURN_IF_NOT_OK( - Uri::NormalizePathWithUserHomeDir(FLAGS_backend_store_dir, "~/.datasystem/rocksdb", "/master")); - std::string preInitRocksDir = FLAGS_backend_store_dir + "/pre-start"; + Uri::NormalizePathWithUserHomeDir(FLAGS_rocksdb_store_dir, "~/.datasystem/rocksdb", "/master")); + std::string preInitRocksDir = FLAGS_rocksdb_store_dir + "/pre-start"; RETURN_IF_NOT_OK(RemoveAll(preInitRocksDir)); if (!FileExist(preInitRocksDir)) { // The permission of ~/.datasystem/rocksdb/object_metadata. @@ -100,7 +100,7 @@ public: // The static members are destructed in the reverse order of their construction, // Below call guarantees that the destructor of Env is behind other Rocksdb singletons. (void)rocksdb::Env::Default(); - FLAGS_backend_store_dir = GetTestCaseDataDir() + "/rocksdb"; + FLAGS_rocksdb_store_dir = GetTestCaseDataDir() + "/rocksdb"; LOG_IF_ERROR(PreInitRocksDB(), "Failed to initialize the rocksdb database in advance."); masterAddr_.ParseString("127.0.0.1:" + std::to_string(GetFreePort())); akSkManager_ = std::make_shared(); @@ -130,7 +130,7 @@ public: objCacheWorkerMsSvc_ = std::make_shared(worker1OcServiceImpl_, akSkManager_); ReplicaManagerParam param; - param.dbRootPath = FLAGS_backend_store_dir; + param.dbRootPath = FLAGS_rocksdb_store_dir; param.currWorkerId = workerUuid_; param.akSkManager = akSkManager_; param.etcdStore = etcdStore_.get(); diff --git a/tests/st/master/object_cache/oc_migrate_metadata_manager_test.cpp b/tests/st/master/object_cache/oc_migrate_metadata_manager_test.cpp index 63810f9..9e61863 100644 --- a/tests/st/master/object_cache/oc_migrate_metadata_manager_test.cpp +++ b/tests/st/master/object_cache/oc_migrate_metadata_manager_test.cpp @@ -48,7 +48,7 @@ #include "datasystem/worker/object_cache/worker_master_oc_api.h" #include "gtest/gtest.h" -DS_DECLARE_string(backend_store_dir); +DS_DECLARE_string(rocksdb_store_dir); DS_DECLARE_string(etcd_address); DS_DECLARE_string(master_address); @@ -79,7 +79,7 @@ public: // The static members are destructed in the reverse order of their construction, // Below call guarantees that the destructor of Env is behind other Rocksdb singletons. (void)rocksdb::Env::Default(); - FLAGS_backend_store_dir = GetTestCaseDataDir() + "/rocksdb"; + FLAGS_rocksdb_store_dir = GetTestCaseDataDir() + "/rocksdb"; LOG_IF_ERROR(PreInitRocksDB(), "Failed to initialize the rocksdb database in advance."); hostPort_.ParseString("127.0.0.1:" + std::to_string(GetFreePort())); akSkManager_ = std::make_shared(); @@ -98,7 +98,7 @@ public: RETURN_IF_NOT_OK(etcdCM_->Init(clusterInfo)); workerUuid_ = etcdCM_->GetLocalWorkerUuid(); ReplicaManagerParam param; - param.dbRootPath = FLAGS_backend_store_dir; + param.dbRootPath = FLAGS_rocksdb_store_dir; param.currWorkerId = workerUuid_; param.akSkManager = akSkManager_; param.etcdStore = etcdStore_.get(); @@ -218,8 +218,8 @@ public: Status PreInitRocksDB() { RETURN_IF_NOT_OK( - Uri::NormalizePathWithUserHomeDir(FLAGS_backend_store_dir, "~/.datasystem/rocksdb", "/master")); - std::string preInitRocksDir = FLAGS_backend_store_dir + "/pre-start"; + Uri::NormalizePathWithUserHomeDir(FLAGS_rocksdb_store_dir, "~/.datasystem/rocksdb", "/master")); + std::string preInitRocksDir = FLAGS_rocksdb_store_dir + "/pre-start"; RETURN_IF_NOT_OK(RemoveAll(preInitRocksDir)); if (!FileExist(preInitRocksDir)) { // The permission of ~/.datasystem/rocksdb/object_metadata. diff --git a/tests/ut/common.h b/tests/ut/common.h index 86332b3..29bf382 100644 --- a/tests/ut/common.h +++ b/tests/ut/common.h @@ -91,6 +91,14 @@ namespace ut { } \ } while (false) +inline bool IsArmArchitecture() { + #if defined(__arm__) || defined(__aarch64__) || defined(__ARM_ARCH) + return true; + #else + return false; + #endif +} + class CommonTest : public testing::Test { public: CommonTest(); diff --git a/tests/ut/common/shared_memory/mmap/mem_mmap_test.cpp b/tests/ut/common/shared_memory/mmap/mem_mmap_test.cpp index 8b148fd..1ec4f7b 100644 --- a/tests/ut/common/shared_memory/mmap/mem_mmap_test.cpp +++ b/tests/ut/common/shared_memory/mmap/mem_mmap_test.cpp @@ -34,6 +34,9 @@ class MemMmapTest : public CommonTest { TEST_F(MemMmapTest, InitFailed) { + if (IsArmArchitecture()) { + GTEST_SKIP() << "Skipped on ARM architecture"; + } memory::MemMmap m; size_t sz = 1024; // init with huge @@ -51,6 +54,9 @@ TEST_F(MemMmapTest, InitFailed) TEST_F(MemMmapTest, CommitFailed) { + if (IsArmArchitecture()) { + GTEST_SKIP() << "Skipped on ARM architecture"; + } memory::MemMmap m; size_t sz = 1024; DS_ASSERT_OK(m.Initialize(sz)); diff --git a/tests/ut/common/shared_memory/shared_disk_detecter_test.cpp b/tests/ut/common/shared_memory/shared_disk_detecter_test.cpp index cb865bb..e6dd4dd 100644 --- a/tests/ut/common/shared_memory/shared_disk_detecter_test.cpp +++ b/tests/ut/common/shared_memory/shared_disk_detecter_test.cpp @@ -64,6 +64,9 @@ Status SharedDiskDetecterTest::FakeOpen(const std::string &pathname, int flags, TEST_F(SharedDiskDetecterTest, TestDiskFullAndRecovery) { + if (IsArmArchitecture()) { + GTEST_SKIP() << "Skipped on ARM architecture"; + } uint64_t intervalMs = 10; uint64_t remainBytes = 100; char path[PATH_MAX + 1] = { 0 }; @@ -84,6 +87,9 @@ TEST_F(SharedDiskDetecterTest, TestDiskFullAndRecovery) TEST_F(SharedDiskDetecterTest, TestDiskIOFailure) { + if (IsArmArchitecture()) { + GTEST_SKIP() << "Skipped on ARM architecture"; + } uint64_t intervalMs = 10; char path[PATH_MAX + 1] = { 0 }; auto ret = getcwd(path, sizeof(path)); @@ -102,6 +108,9 @@ TEST_F(SharedDiskDetecterTest, TestDiskIOFailure) TEST_F(SharedDiskDetecterTest, TestDiskOpenFailure) { + if (IsArmArchitecture()) { + GTEST_SKIP() << "Skipped on ARM architecture"; + } uint64_t intervalMs = 10; char path[PATH_MAX + 1] = { 0 }; auto ret = getcwd(path, sizeof(path)); diff --git a/tests/ut/master/object_cache/expired_object_manager_test.cpp b/tests/ut/master/object_cache/expired_object_manager_test.cpp index 19edae3..f9e617b 100644 --- a/tests/ut/master/object_cache/expired_object_manager_test.cpp +++ b/tests/ut/master/object_cache/expired_object_manager_test.cpp @@ -29,7 +29,7 @@ #include "datasystem/common/immutable_string/immutable_string.h" #include "datasystem/common/inject/inject_point.h" -DS_DECLARE_string(backend_store_dir); +DS_DECLARE_string(rocksdb_store_dir); using namespace datasystem::master; namespace datasystem { diff --git a/tests/ut/master/object_cache/oc_notify_worker_manager_test.cpp b/tests/ut/master/object_cache/oc_notify_worker_manager_test.cpp index 067a63d..0349856 100644 --- a/tests/ut/master/object_cache/oc_notify_worker_manager_test.cpp +++ b/tests/ut/master/object_cache/oc_notify_worker_manager_test.cpp @@ -27,7 +27,7 @@ #include "datasystem/common/signal/signal.h" #include "datasystem/master/object_cache/oc_metadata_manager.h" -DS_DECLARE_string(backend_store_dir); +DS_DECLARE_string(rocksdb_store_dir); using namespace ::testing; using namespace datasystem::master; -- Gitee