Skip to content

Conversation

@samika98
Copy link
Contributor

@samika98 samika98 commented May 6, 2024

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.

@samika98 samika98 marked this pull request as draft May 6, 2024 21:37
@samika98 samika98 changed the title feat/new model_reuse_type to enable sync by peers and creation by leader feat: new model_reuse_type to enable sync by peers and creation by leader May 6, 2024
&small_model_id,
&large_model_id,
config.params.number_of_documents,
global_leader,
Copy link
Collaborator

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.

Suggested change
global_leader,
true,

Copy link
Collaborator

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.

}
};

if lead_user {
Copy link
Collaborator

@smrz2001 smrz2001 May 6, 2024

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.

redis_cli: &redis::Client,
should_create: bool,
redis_postfix: Option<String>,
should_subscribe: bool,
Copy link
Collaborator

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.

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.

3 participants