summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Davis <mcarsondavis@gmail.com>2023-03-14 15:05:24 -0500
committerDiana Parra Corbacho <dparracorbac@vmware.com>2023-05-12 11:31:16 +0200
commit1ec9b281687831d5340e798c7d0ed2290f7e06ad (patch)
tree9e8492a4cd61da6f38dbc4c14f01340f1af77cd6
parentc203a2f167fdcd669355e050296b23c8f7a09495 (diff)
downloadrabbitmq-server-git-1ec9b281687831d5340e798c7d0ed2290f7e06ad.tar.gz
Update khepri with pattern tree refactor for projections
This change to Khepri uses a tree of patterns to store and lookup projections when tree node in the store changes. This reduces the amount of work the machine needs to perform to determine which projections should be triggered for any change to the store which improves the performance of large operations like 'rabbitmqctl import_definitions' for 1 million topic bindings. Also included is a fix for the type definition of the 'if_data_matches' condition which fixes a Dialyzer error in the rabbit application.
-rw-r--r--MODULE.bazel2
-rw-r--r--bazel/BUILD.khepri14
-rwxr-xr-xmoduleindex.yaml1
3 files changed, 16 insertions, 1 deletions
diff --git a/MODULE.bazel b/MODULE.bazel
index 40290da443..7d8663beb0 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -242,7 +242,7 @@ erlang_package.hex_package(
erlang_package.git_package(
name = "khepri",
build_file = "@rabbitmq-server//bazel:BUILD.khepri",
- commit = "7a8587d894d189626420d66212dc78719bfe12a5",
+ commit = "295bf1e91a20e5260ee3df9fdb8423b16c1d518a",
repository = "rabbitmq/khepri",
)
diff --git a/bazel/BUILD.khepri b/bazel/BUILD.khepri
index d0e3caa75e..dc69828e5b 100644
--- a/bazel/BUILD.khepri
+++ b/bazel/BUILD.khepri
@@ -178,6 +178,18 @@ erlang_bytecode(
)
erlang_bytecode(
+ name = "ebin_khepri_pattern_tree_beam",
+ srcs = ["src/khepri_pattern_tree.erl"],
+ outs = ["ebin/khepri_pattern_tree.beam"],
+ hdrs = [
+ "src/khepri_payload.hrl",
+ "src/khepri_tree.hrl",
+ ],
+ app_name = "khepri",
+ erlc_opts = "//:erlc_opts",
+)
+
+erlang_bytecode(
name = "ebin_khepri_payload_beam",
srcs = ["src/khepri_payload.erl"],
outs = ["ebin/khepri_payload.beam"],
@@ -303,6 +315,7 @@ filegroup(
"ebin/khepri_import_export.beam",
"ebin/khepri_machine.beam",
"ebin/khepri_path.beam",
+ "ebin/khepri_pattern_tree.beam",
"ebin/khepri_payload.beam",
"ebin/khepri_projection.beam",
"ebin/khepri_sproc.beam",
@@ -330,6 +343,7 @@ filegroup(
"src/khepri_import_export.erl",
"src/khepri_machine.erl",
"src/khepri_path.erl",
+ "src/khepri_pattern_tree.erl",
"src/khepri_payload.erl",
"src/khepri_projection.erl",
"src/khepri_sproc.erl",
diff --git a/moduleindex.yaml b/moduleindex.yaml
index fcabe5abe7..cb643c4756 100755
--- a/moduleindex.yaml
+++ b/moduleindex.yaml
@@ -327,6 +327,7 @@ khepri:
- khepri_import_export
- khepri_machine
- khepri_path
+- khepri_pattern_tree
- khepri_payload
- khepri_projection
- khepri_sproc