-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: new model_reuse_type to enable sync by peers and creation by leader #170
base: main
Are you sure you want to change the base?
Conversation
&small_model_id, | ||
&large_model_id, | ||
config.params.number_of_documents, | ||
global_leader, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be true
so that each worker creates MIDs instead of just the global leader.
global_leader, | |
true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, we need the ReuseType::Shared
code when creating models, but ReuseType::PerUser
code when creating MIDs.
Self::ensure_model_exists(user, &config.user_cli, &small).await?; | ||
Self::ensure_model_exists(user, &config.user_cli, &large).await?; | ||
(small, large) | ||
} | ||
}; | ||
|
||
if lead_user { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of this if
-block, one user per worker will call the model subscription API, which means each node will already be subscribed to the models. This means that we shouldn't need to pass the should_subscribe
flag as you're doing below.
@@ -293,6 +330,7 @@ impl CeramicModelInstanceTestUser { | |||
redis_cli: &redis::Client, | |||
should_create: bool, | |||
redis_postfix: Option<String>, | |||
should_subscribe: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be necessary - see my comment above. One user on each worker is already making sure that the corresponding node is subscribed to the models.
Added a Model Reuse Type to help us configure Goose Scenario. This Reuse type lets the global leader (worker with id 0) create models and all the users including the leader (ceramic nodes) subscribe to that model.