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

Attach to cluster controller through Networking #1500

Merged
merged 1 commit into from
May 21, 2024
Merged

Attach to cluster controller through Networking #1500

merged 1 commit into from
May 21, 2024

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented May 10, 2024

Attach to cluster controller through Networking

This PR includes:

  • Attachment of PPM to cluster controller now use Networking
  • PPM observes partition processor status through a buffered watch mechanism
  • PPM can now send control messages (unused at this PR) to processor for future use.
  • PPM collects state information from running processors. This will be used in a follow PR to response to controller requests about partitions.

Cluster controller grpc service is kept for external tooling integration (CLI, etc.)


Stack created with Sapling. Best reviewed with ReviewStack.

Copy link

github-actions bot commented May 10, 2024

Test Results

 99 files  ±0   99 suites  ±0   8m 5s ⏱️ -51s
 84 tests ±0   82 ✅ ±0  2 💤 ±0  0 ❌ ±0 
215 runs   - 1  209 ✅  - 1  6 💤 ±0  0 ❌ ±0 

Results for commit 4f22a93. ± Comparison against base commit 1d7ac91.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
dev.restate.e2e.JavaWorkflowAPITest ‑ Workflow cannot be submitted more than once
dev.restate.e2e.runtime.IngressTest ‑ Idempotent send then attach/getOutput

♻️ This comment has been updated with latest results.

@AhmedSoliman AhmedSoliman changed the title WIP cluster controller api Attach to cluster controller through Networking May 10, 2024
@AhmedSoliman AhmedSoliman marked this pull request as ready for review May 10, 2024 12:46
@AhmedSoliman
Copy link
Contributor Author

Linter error is on generated code, this will be fixed in the next PR in this stack.

@AhmedSoliman
Copy link
Contributor Author

Significant changes are incoming to this PR, putting this back as WIP.

@AhmedSoliman AhmedSoliman removed the request for review from tillrohrmann May 13, 2024 10:22
@AhmedSoliman AhmedSoliman changed the title Attach to cluster controller through Networking [WIP] Attach to cluster controller through Networking May 13, 2024
Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Some intermediate review comments for a718fcd. Waiting for the PR to be updated before continuing with the review.

crates/worker/src/partition/mod.rs Outdated Show resolved Hide resolved
crates/worker/src/partition/mod.rs Outdated Show resolved Hide resolved
crates/worker/src/metric_definitions.rs Outdated Show resolved Hide resolved
crates/worker/src/partition/mod.rs Outdated Show resolved Hide resolved
@AhmedSoliman AhmedSoliman changed the title [WIP] Attach to cluster controller through Networking Attach to cluster controller through Networking May 14, 2024
@AhmedSoliman AhmedSoliman force-pushed the pr1500 branch 6 times, most recently from baeeec4 to 25896ae Compare May 14, 2024 12:28
@AhmedSoliman
Copy link
Contributor Author

This should be ready for review. PTAL @tillrohrmann.

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Nice work @AhmedSoliman. LGTM. +1 for merging :-)

Ok(Response::new(AttachmentResponse {}))
_request: tonic::Request<ClusterStateRequest>,
) -> Result<tonic::Response<ClusterStateResponse>, tonic::Status> {
unimplemented!()
Copy link
Contributor

Choose a reason for hiding this comment

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

Not that anyone is calling this endpoint but maybe let's return an error instead of causing a panic in case a stranger calls it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It shouldn't panic the runtime, but better to change this to an error code instead.

Comment on lines -62 to +97
running_partition_processors: HashMap::default(),
running_partition_processors: BTreeMap::default(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is BTreeMap faster than HashMap for small number of entries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, it's also more cacheline friendly, and in general better when keys are small and numeric.

This PR includes:
- Attachment of PPM to cluster controller now use Networking
- PPM observes partition processor status through a buffered watch mechanism
- PPM can now send control messages (unused at this PR) to processor for future use.
- PPM collects state information from running processors. This will be used in a follow PR to response to controller requests about partitions.


Cluster controller grpc service is kept for external tooling integration (CLI, etc.)
@AhmedSoliman AhmedSoliman merged commit 03418f4 into main May 21, 2024
10 checks passed
@AhmedSoliman AhmedSoliman deleted the pr1500 branch May 21, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants