chore: more fixes for macos (#2677)

1.Add back the search files to MacOs build (linker errors are fixed now).
2. Add default maxmemory argument (if not present already) when launching dragonfly process in regression tests.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-03-02 23:14:33 +02:00 committed by GitHub
parent 9698f974ea
commit 93debc754c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 59 deletions

View file

@ -31,11 +31,8 @@ add_library(dfly_transaction db_slice.cc malloc_stats.cc blocking_controller.cc
${TX_LINUX_SRCS} acl/acl_log.cc slowlog.cc
)
if (NOT APPLE)
SET(SEARCH_FILES search/search_family.cc search/doc_index.cc search/doc_accessors.cc search/aggregator.cc)
cxx_test(search/search_family_test dfly_test_lib LABELS DFLY)
cxx_test(search/aggregator_test dfly_test_lib LABELS DFLY)
endif()
SET(SEARCH_FILES search/search_family.cc search/doc_index.cc search/doc_accessors.cc
search/aggregator.cc)
add_library(dragonfly_lib engine_shard_set.cc channel_store.cc
config_registry.cc conn_context.cc debugcmd.cc dflycmd.cc
@ -103,6 +100,8 @@ cxx_test(cluster/cluster_family_test dfly_test_lib LABELS DFLY)
cxx_test(acl/user_registry_test dfly_test_lib LABELS DFLY)
cxx_test(acl/acl_family_test dfly_test_lib LABELS DFLY)
cxx_test(engine_shard_set_test dfly_test_lib LABELS DFLY)
cxx_test(search/search_family_test dfly_test_lib LABELS DFLY)
cxx_test(search/aggregator_test dfly_test_lib LABELS DFLY)

View file

@ -2547,10 +2547,7 @@ void Service::RegisterCommands() {
JsonFamily::Register(&registry_);
BitOpsFamily::Register(&registry_);
HllFamily::Register(&registry_);
#ifndef __APPLE__
SearchFamily::Register(&registry_);
#endif
server_family_.Register(&registry_);
cluster_family_.Register(&registry_);

View file

@ -1298,7 +1298,6 @@ RdbSaver::GlobalData RdbSaver::GetGlobalData(const Service* service) {
script_bodies.push_back(std::move(data.body));
}
#ifndef __APPLE__
{
shard_set->Await(0, [&] {
auto* indices = EngineShard::tlocal()->search_indices();
@ -1309,7 +1308,6 @@ RdbSaver::GlobalData RdbSaver::GetGlobalData(const Service* service) {
}
});
}
#endif
return RdbSaver::GlobalData{std::move(script_bodies), std::move(search_indices)};
}

View file

@ -175,53 +175,4 @@ class ShardDocIndices {
absl::flat_hash_map<std::string, std::unique_ptr<ShardDocIndex>> indices_;
};
#if defined(__APPLE__)
inline ShardDocIndices::ShardDocIndices() : local_mr_{nullptr} {
}
inline ShardDocIndex* ShardDocIndices::GetIndex(std::string_view name) {
return nullptr;
}
inline void ShardDocIndices::InitIndex(const OpArgs& op_args, std::string_view name,
std::shared_ptr<DocIndex> index) {
}
inline bool ShardDocIndices::DropIndex(std::string_view name) {
return false;
}
inline void ShardDocIndices::RebuildAllIndices(const OpArgs& op_args) {
}
inline std::vector<std::string> ShardDocIndices::GetIndexNames() const {
return {};
}
inline void ShardDocIndices::AddDoc(std::string_view key, const DbContext& db_cnt,
const PrimeValue& pv) {
}
inline void ShardDocIndices::RemoveDoc(std::string_view key, const DbContext& db_cnt,
const PrimeValue& pv) {
}
inline size_t ShardDocIndices::GetUsedMemory() const {
return 0;
}
inline SearchStats ShardDocIndices::GetStats() const {
return {};
}
inline DocIndexInfo ShardDocIndex::GetInfo() const {
return {};
}
inline std::string DocIndexInfo::BuildRestoreCommand() const {
return {};
}
#endif // __APPLE__
} // namespace dfly

View file

@ -319,6 +319,8 @@ class DflyInstanceFactory:
args.setdefault("dbfilename", "")
args.setdefault("jsonpathv2", None)
# MacOs does not set it automatically, so we need to set it manually
args.setdefault("maxmemory", "8G")
vmod = "dragonfly_connection=1,accept_server=1,listener_interface=1,main_service=1,rdb_save=1,replica=1,cluster_family=1"
args.setdefault("vmodule", vmod)