From 1b64a45f10327ca4c77d71be4aa96e33dbd5479a Mon Sep 17 00:00:00 2001 From: jbajic Date: Wed, 25 Jan 2023 12:03:36 +0100 Subject: [PATCH] Add split parameter into config --- src/coordinator/shard_map.cpp | 2 +- src/coordinator/shard_map.hpp | 2 +- src/query/v2/request_router.hpp | 2 +- src/storage/v3/bindings/db_accessor.hpp | 2 +- src/storage/v3/config.hpp | 4 ++++ src/storage/v3/mvcc.hpp | 2 +- src/storage/v3/property_value.hpp | 2 +- src/storage/v3/shard.cpp | 2 +- 8 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/coordinator/shard_map.cpp b/src/coordinator/shard_map.cpp index e9757953e..f38e6f823 100644 --- a/src/coordinator/shard_map.cpp +++ b/src/coordinator/shard_map.cpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2022 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source diff --git a/src/coordinator/shard_map.hpp b/src/coordinator/shard_map.hpp index aa59bbf6c..fc408e965 100644 --- a/src/coordinator/shard_map.hpp +++ b/src/coordinator/shard_map.hpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2022 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source diff --git a/src/query/v2/request_router.hpp b/src/query/v2/request_router.hpp index 44a423ef0..3dd2f164b 100644 --- a/src/query/v2/request_router.hpp +++ b/src/query/v2/request_router.hpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2022 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source diff --git a/src/storage/v3/bindings/db_accessor.hpp b/src/storage/v3/bindings/db_accessor.hpp index 852724b85..6392ed18f 100644 --- a/src/storage/v3/bindings/db_accessor.hpp +++ b/src/storage/v3/bindings/db_accessor.hpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2022 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source diff --git a/src/storage/v3/config.hpp b/src/storage/v3/config.hpp index 05179c6b0..868e82f21 100644 --- a/src/storage/v3/config.hpp +++ b/src/storage/v3/config.hpp @@ -30,6 +30,10 @@ struct Config { io::Duration reclamation_interval{}; } gc; + struct Split { + uint64_t max_shard_vertex_size{500'000}; + } split; + struct Items { bool properties_on_edges{true}; } items; diff --git a/src/storage/v3/mvcc.hpp b/src/storage/v3/mvcc.hpp index 9cd5ca3ff..6ce058d62 100644 --- a/src/storage/v3/mvcc.hpp +++ b/src/storage/v3/mvcc.hpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2022 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source diff --git a/src/storage/v3/property_value.hpp b/src/storage/v3/property_value.hpp index 80fbb409a..56902bed5 100644 --- a/src/storage/v3/property_value.hpp +++ b/src/storage/v3/property_value.hpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2022 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source diff --git a/src/storage/v3/shard.cpp b/src/storage/v3/shard.cpp index 566029b9c..d2ede3603 100644 --- a/src/storage/v3/shard.cpp +++ b/src/storage/v3/shard.cpp @@ -1100,7 +1100,7 @@ void Shard::StoreMapping(std::unordered_map id_to_name) { } std::optional Shard::ShouldSplit() const noexcept { - if (vertices_.size() > 10000000) { + if (vertices_.size() > config_.split.max_shard_vertex_size) { // Why should we care if the selected vertex is deleted auto mid_elem = vertices_.begin(); // mid_elem->first