You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by gk...@apache.org on 2026/03/03 14:53:18 UTC
(iggy) branch fix_mux_plane_generics created (now 24af899c2)
This is an automated email from the ASF dual-hosted git repository.
gkoszyk pushed a change to branch fix_mux_plane_generics
in repository https://gitbox.apache.org/repos/asf/iggy.git
at 24af899c2 fix(cluster): fix type mismatch for variadic plane impl
This branch includes the following new commits:
new 24af899c2 fix(cluster): fix type mismatch for variadic plane impl
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(iggy) 01/01: fix(cluster): fix type mismatch for variadic plane impl
Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gkoszyk pushed a commit to branch fix_mux_plane_generics
in repository https://gitbox.apache.org/repos/asf/iggy.git
commit 24af899c2e9d7434912572d5f0c0e1452b28fd8a
Author: numinex <g....@gmail.com>
AuthorDate: Tue Mar 3 15:53:10 2026 +0100
fix(cluster): fix type mismatch for variadic plane impl
---
core/common/src/macros.rs | 8 ++++----
core/metadata/src/impls/metadata.rs | 9 ++++-----
core/partitions/src/iggy_partitions.rs | 9 ++++-----
core/shard/src/lib.rs | 13 ++++++-------
4 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/core/common/src/macros.rs b/core/common/src/macros.rs
index c7c1ce3f6..09ec4c496 100644
--- a/core/common/src/macros.rs
+++ b/core/common/src/macros.rs
@@ -19,9 +19,9 @@
macro_rules! variadic {
() => (());
(...$a:ident $(,)?) => ($a);
- (...$a:expr $(,)?) => ($a);
- ($a:ident $(,)?) => (($a, ()));
- ($a:expr $(,)?) => (($a, ()));
+ (...$a:ty $(,)?) => ($a);
($a:ident, $($b:tt)+) => (($a, $crate::variadic!($($b)+)));
- ($a:expr, $($b:tt)+) => (($a, $crate::variadic!($($b)+)));
+ ($a:ty, $($b:tt)+) => (($a, $crate::variadic!($($b)+)));
+ ($a:ident $(,)?) => (($a, ()));
+ ($a:ty $(,)?) => (($a, ()));
}
diff --git a/core/metadata/src/impls/metadata.rs b/core/metadata/src/impls/metadata.rs
index 64f9fe959..bf23b0190 100644
--- a/core/metadata/src/impls/metadata.rs
+++ b/core/metadata/src/impls/metadata.rs
@@ -100,15 +100,14 @@ pub struct IggyMetadata<C, J, S, M> {
pub mux_stm: M,
}
-impl<B, P, J, S, M> Plane<VsrConsensus<B, P>> for IggyMetadata<VsrConsensus<B, P>, J, S, M>
+impl<B,J, S, M> Plane<VsrConsensus<B>> for IggyMetadata<VsrConsensus<B>, J, S, M>
where
B: MessageBus<Replica = u8, Data = Message<GenericHeader>, Client = u128>,
- P: Pipeline<Message = Message<PrepareHeader>, Entry = PipelineEntry>,
J: JournalHandle,
J::Target: Journal<J::Storage, Entry = Message<PrepareHeader>, Header = PrepareHeader>,
M: StateMachine<Input = Message<PrepareHeader>>,
{
- async fn on_request(&self, message: <VsrConsensus<B, P> as Consensus>::Message<RequestHeader>) {
+ async fn on_request(&self, message: <VsrConsensus<B> as Consensus>::Message<RequestHeader>) {
let consensus = self.consensus.as_ref().unwrap();
// TODO: Bunch of asserts.
@@ -119,7 +118,7 @@ where
async fn on_replicate(
&self,
- message: <VsrConsensus<B, P> as Consensus>::Message<PrepareHeader>,
+ message: <VsrConsensus<B> as Consensus>::Message<PrepareHeader>,
) {
let consensus = self.consensus.as_ref().unwrap();
let journal = self.journal.as_ref().unwrap();
@@ -174,7 +173,7 @@ where
}
}
- async fn on_ack(&self, message: <VsrConsensus<B, P> as Consensus>::Message<PrepareOkHeader>) {
+ async fn on_ack(&self, message: <VsrConsensus<B> as Consensus>::Message<PrepareOkHeader>) {
let consensus = self.consensus.as_ref().unwrap();
let header = message.header();
diff --git a/core/partitions/src/iggy_partitions.rs b/core/partitions/src/iggy_partitions.rs
index f05b294db..f7fa09763 100644
--- a/core/partitions/src/iggy_partitions.rs
+++ b/core/partitions/src/iggy_partitions.rs
@@ -333,14 +333,13 @@ impl<C> IggyPartitions<C> {
}
}
-impl<B> Plane<VsrConsensus<B, NamespacedPipeline>>
- for IggyPartitions<VsrConsensus<B, NamespacedPipeline>>
+impl<B> Plane<VsrConsensus<B>> for IggyPartitions<VsrConsensus<B, NamespacedPipeline>>
where
B: MessageBus<Replica = u8, Data = Message<GenericHeader>, Client = u128>,
{
async fn on_request(
&self,
- message: <VsrConsensus<B, NamespacedPipeline> as Consensus>::Message<RequestHeader>,
+ message: <VsrConsensus<B> as Consensus>::Message<RequestHeader>,
) {
let namespace = IggyNamespace::from_raw(message.header().namespace);
let consensus = self
@@ -354,7 +353,7 @@ where
async fn on_replicate(
&self,
- message: <VsrConsensus<B, NamespacedPipeline> as Consensus>::Message<PrepareHeader>,
+ message: <VsrConsensus<B> as Consensus>::Message<PrepareHeader>,
) {
let header = message.header();
let namespace = IggyNamespace::from_raw(header.namespace);
@@ -399,7 +398,7 @@ where
async fn on_ack(
&self,
- message: <VsrConsensus<B, NamespacedPipeline> as Consensus>::Message<PrepareOkHeader>,
+ message: <VsrConsensus<B> as Consensus>::Message<PrepareOkHeader>,
) {
let header = message.header();
let consensus = self.consensus().expect("on_ack: consensus not initialized");
diff --git a/core/shard/src/lib.rs b/core/shard/src/lib.rs
index 0b41b1d84..40161b9cc 100644
--- a/core/shard/src/lib.rs
+++ b/core/shard/src/lib.rs
@@ -26,13 +26,12 @@ use metadata::IggyMetadata;
use metadata::stm::StateMachine;
use partitions::IggyPartitions;
-// variadic!(Metadata, Partitions) = (Metadata, (Partitions, ()))
-type PlaneInner<B, J, S, M> = (
- IggyMetadata<VsrConsensus<B>, J, S, M>,
- (IggyPartitions<VsrConsensus<B, NamespacedPipeline>>, ()),
-);
-
-pub type ShardPlane<B, J, S, M> = MuxPlane<PlaneInner<B, J, S, M>>;
+pub type ShardPlane<B, J, S, M> = MuxPlane<
+ variadic!(
+ IggyMetadata<VsrConsensus<B>, J, S, M>,
+ IggyPartitions<VsrConsensus<B, NamespacedPipeline>>
+ ),
+>;
pub struct IggyShard<B, J, S, M>
where