Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster state refresher #2429

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/types/protobuf/restate/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ enum TargetName {
// Node
NODE_GET_PARTITIONS_PROCESSORS_STATE_REQUEST = 60;
NODE_GET_PARTITIONS_PROCESSORS_STATE_RESPONSE = 61;
NODE_PING = 62;
NODE_PONG = 63;

// Remote Scanner
REMOTE_QUERY_SCANNER_OPEN = 80;
Expand Down
1 change: 0 additions & 1 deletion crates/types/src/cluster/cluster_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ impl ClusterState {
})
}

#[cfg(any(test, feature = "test-util"))]
pub fn empty() -> Self {
ClusterState {
last_refreshed: None,
Expand Down
28 changes: 28 additions & 0 deletions crates/types/src/net/cluster_state.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) 2023 - 2025 Restate Software, Inc., Restate GmbH.
// All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

use super::{define_rpc, TargetName};
use serde::{Deserialize, Serialize};

define_rpc! {
@request= NodePing,
@response= NodePong,
@request_target=TargetName::NodePing,
@response_target=TargetName::NodePong,
}

/// Gossip Push message. Is pushed from each node to every other known node
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NodePing {
//todo(azmy): share latest metadata versions?
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NodePong {}
Comment on lines +27 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you imagine will be in response and do we actually need a response?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point :) Pongs are definitely not needed as their own message type and can be dropped. The failure detector still treat it as a ping anyway.

1 change: 1 addition & 0 deletions crates/types/src/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

pub mod cluster_state;
pub mod codec;
mod error;
pub mod log_server;
Expand Down
Loading