Skip to content

Add PreferSameShardOnResizeWeigher.#316

Merged
kpawar-sap merged 1 commit intostable/rocky-m3from
resize_prefer_local_vc
Apr 6, 2022
Merged

Add PreferSameShardOnResizeWeigher.#316
kpawar-sap merged 1 commit intostable/rocky-m3from
resize_prefer_local_vc

Conversation

@kpawar-sap
Copy link
Copy Markdown

This filter enable to select same host-aggregate/shard/VC for instance
resize because it could take more time to migrate the volumes over other
shards.

@kpawar-sap kpawar-sap requested a review from fwiesel March 11, 2022 08:35
@kpawar-sap kpawar-sap force-pushed the resize_prefer_local_vc branch from ebe01f0 to f0c83be Compare March 11, 2022 08:43
Copy link
Copy Markdown

@joker-at-work joker-at-work left a comment

Choose a reason for hiding this comment

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

Please rename to shard, as it doesn't allow to configure the aggregate and thus the more generic "PreferSameAggregate" is not telling the story correctly.

@kpawar-sap kpawar-sap force-pushed the resize_prefer_local_vc branch 2 times, most recently from e0d116c to 89d5b25 Compare March 11, 2022 14:06
@kpawar-sap kpawar-sap changed the title Add PreferSameAggregateOnResizeWeigher. Add PreferSameShardOnResizeWeigher. Mar 11, 2022
@kpawar-sap kpawar-sap force-pushed the resize_prefer_local_vc branch from 89d5b25 to 3ed14b8 Compare March 14, 2022 11:18
@kpawar-sap
Copy link
Copy Markdown
Author

Please rename to shard, as it doesn't allow to configure the aggregate and thus the more generic "PreferSameAggregate" is not telling the story correctly.

Done. Tested on qa-de-1.

@kpawar-sap kpawar-sap closed this Mar 14, 2022
@kpawar-sap kpawar-sap reopened this Mar 14, 2022
Copy link
Copy Markdown
Member

@fwiesel fwiesel left a comment

Choose a reason for hiding this comment

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

Otherwise, it looks good to me

@kpawar-sap kpawar-sap force-pushed the resize_prefer_local_vc branch from 3ed14b8 to 996f266 Compare March 15, 2022 15:07
Copy link
Copy Markdown

@joker-at-work joker-at-work left a comment

Choose a reason for hiding this comment

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

There's a test missing that actually tests the same shard part of the weigher. Please add an additional host to your tests that's in the same shard as one of the existing hosts. This host should have the same weight given by the weigher as the other host in that shard in every test.

I assume this test with then show a bug in your weigher, as the weigher returns 0.0 if the instance is not on the currently-checked host through the first if.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why does a new instance have _nova_check_type: ['resize'] set?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

just to tell that even if resize is triggered with new instance it wont work since instance is new and "source_host" is missing

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is not clear from the code, as a new instance normally wouldn't have resize set. Please add a comment that explains why, so anybody reading the code later on can understand it.

@kpawar-sap kpawar-sap force-pushed the resize_prefer_local_vc branch from 996f266 to db8fe1a Compare April 4, 2022 12:22
@kpawar-sap kpawar-sap requested a review from joker-at-work April 4, 2022 12:24
Comment on lines 66 to 67
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we need a set() here?
Why do we need the iterator here instead of directly using host_shard_aggr.host?
Wouldn't if instance_host in host_shard_aggr.hosts: do the same in just one line with the same readability?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is not clear from the code, as a new instance normally wouldn't have resize set. Please add a comment that explains why, so anybody reading the code later on can understand it.

This filter enable to select same host-aggregate/shard/VC for instance
resize because it could take more time to migrate the volumes over other
shards.
@kpawar-sap kpawar-sap force-pushed the resize_prefer_local_vc branch from db8fe1a to fd4c33b Compare April 5, 2022 15:58
@kpawar-sap kpawar-sap requested a review from joker-at-work April 5, 2022 15:59
@kpawar-sap kpawar-sap merged commit f648b9b into stable/rocky-m3 Apr 6, 2022
@kpawar-sap kpawar-sap deleted the resize_prefer_local_vc branch April 6, 2022 08:56
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