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

fix: Prevent Coordinator from stopping V1 executors #544

Merged
merged 4 commits into from
Jan 31, 2024

Conversation

morgsmccauley
Copy link
Collaborator

@morgsmccauley morgsmccauley commented Jan 30, 2024

As V1 executors are returned via Runner gRPC, Coordinator V2 will attempt to synchronise them. These executors should be completely ignored, within the synchronisation logic.

@morgsmccauley morgsmccauley changed the title fix/coordinator stops v1 executor fix: Prevent Coordinator from stopping V1 indexers Jan 30, 2024
@morgsmccauley morgsmccauley linked an issue Jan 30, 2024 that may be closed by this pull request
@morgsmccauley morgsmccauley force-pushed the fix/coordinator-stops-v1-executor branch 2 times, most recently from 3c55ec6 to 0bdf08b Compare January 30, 2024 23:24
@morgsmccauley morgsmccauley changed the title fix: Prevent Coordinator from stopping V1 indexers fix: Prevent Coordinator from stopping V1 executors Jan 30, 2024
@morgsmccauley morgsmccauley force-pushed the fix/coordinator-stops-v1-executor branch from 0bdf08b to 9c8021b Compare January 30, 2024 23:42
@@ -1,3 +1,5 @@
#![cfg_attr(test, allow(dead_code))]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the impl is mocked in test builds, the actual implementation warns dead_code, as it isn't used with the tests. This suppresses these errors for test builds, code that is not used in normal builds will still warn.

@@ -102,7 +102,7 @@ function getRunnerService (executors: Map<string, StreamHandler>, StreamHandlerT
config = {
account_id: accountId,
function_name: functionName,
version: -1, // Ensure Coordinator V2 sees version mismatch
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As version is uint64 this ends up being a the largest possible 64 bit int.

@morgsmccauley morgsmccauley marked this pull request as ready for review January 30, 2024 23:45
@morgsmccauley morgsmccauley requested a review from a team as a code owner January 30, 2024 23:45
Copy link
Collaborator

@darunrs darunrs left a comment

Choose a reason for hiding this comment

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

The changes look good to me!

We still need to add an allowlist block on Block Streamer, and also add logs to it (For when it successfully completes a start or stop command). We could do that in a separate PR but we just gotta be careful as once we deploy this PR and the triggers run, V2 coordinator will go and kick off every block streamer it can, which spikes Runner/Redis load. We would want to either implement the block streamer allowlist in this PR too, or be ready to action on dev. I'll leave it up to you!

Also, I haven't actually flushed the streams yet. Do you mind doing it? Sorry!

@morgsmccauley
Copy link
Collaborator Author

morgsmccauley commented Jan 31, 2024

@darunrs Implementing the allowlist in Block Streamer isn't necessary - Coordinator will not attempt to manage any indexers which aren't in the allowlist. The only reason this change here is necessary is because the V1 executors are started (via the redis set) and Coordinator believes they shouldn't exist.

I'll add logging in a follow up PR :)

Also, I haven't actually flushed the streams yet. Do you mind doing it? Sorry!

Yup I can do it :)

@morgsmccauley morgsmccauley merged commit 593f305 into main Jan 31, 2024
7 checks passed
@morgsmccauley morgsmccauley deleted the fix/coordinator-stops-v1-executor branch January 31, 2024 01:59
@darunrs darunrs mentioned this pull request Feb 1, 2024
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.

Coordinator not respecting allowlist
2 participants