-
Notifications
You must be signed in to change notification settings - Fork 992
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
all: Indicate whether to only locate active deployment #4395
Conversation
core/src/subgraph/registrar.rs
Outdated
@@ -411,7 +411,7 @@ where | |||
hash: &DeploymentHash, | |||
node_id: &NodeId, | |||
) -> Result<(), SubgraphRegistrarError> { | |||
let locations = self.store.locators(hash)?; | |||
let locations = self.store.locators(hash, 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.
We expect this to return a vector with a single DeploymentLocator
(the active copy), right?
graph/src/components/store/traits.rs
Outdated
/// If `only_active` is `true`, only the locator for the active | ||
/// deployment will be returned. If it is `false`, locators for all | ||
/// deployments with this hash will be returned. | ||
fn locators(&self, hash: &str, only_active: 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.
I think we should split this into something like all_locators
and active_locators
instead of using a flag, when someone is using or reading this function with a bool they need to go read the docs to figure what the bool is used for, when using all/active naming then it's obvious both when writing and when reading the code.
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.
I just removed the boolean flag and added a fn active_locator
to the trait
2b58fb9
to
6e5b2dd
Compare
The reassign_subgraph JSON-RPC call will fail if a deployment exists in multiple shards. To disambiguate that, change the call so that it only affects the active deployment. Fixes #4394
9eb6bfd
to
3f7fe67
Compare
The reassign_subgraph JSON-RPC call will fail if a deployment exists in multiple shards. To disambiguate that, change the call so that it only affects the active deployment.
Fixes #4394