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

Clarify data migration function and unit tests #2845

Merged
merged 1 commit into from
Apr 9, 2020

Conversation

sebgl
Copy link
Contributor

@sebgl sebgl commented Apr 9, 2020

I got confused by the comment attached to the IsMigratingData
function, along with its unit tests. They somehow indicate we're
checking if a node has the only copy of a shard.
But the reality is we just check if there's any shard on that node.

This commit renames the function to ShardsOnNode(), modifies the
comment accordingly, and adapts the unit tests to the simple function logic.

I got confused by the comment attached to the `IsMigratingData`
function, along with its unit tests. They somehow indicate we're
checking if a node has the only copy of a shard.
But the reality is we just check if there's any shard on that node.

This commit renames the function to `ShardsOnNode()`, modifies the
comment accordingly, and adapt the unit tests to the very simple logic
of the function.
Copy link
Collaborator

@pebrc pebrc left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning this up! LGTM

@sebgl sebgl merged commit 333ba6c into elastic:master Apr 9, 2020
barkbay pushed a commit to barkbay/cloud-on-k8s that referenced this pull request Apr 15, 2020
I got confused by the comment attached to the `IsMigratingData`
function, along with its unit tests. They somehow indicate we're
checking if a node has the only copy of a shard.
But the reality is we just check if there's any shard on that node.

This commit renames the function to `ShardsOnNode()`, modifies the
comment accordingly, and adapt the unit tests to the very simple logic
of the function.
barkbay added a commit that referenced this pull request Apr 15, 2020
* Clarify data migration function and unit tests (#2845)
* Do not use annotations to cache Elasticsearch API calls (#2880)

Co-authored-by: Sebastien Guilloux <contact.sebgl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants