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

IGNITE-23870 Implement a method to receive a chain of topology changes #4966

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Cyrill
Copy link
Contributor

@Cyrill Cyrill commented Dec 24, 2024

*
* @param partId Unique identifier of a partition.
* @return Key for a partition.
* @see <a href="https://github.com/apache/ignite-3/blob/main/modules/table/tech-notes/rebalance.md">Rebalance documentation</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no information about this key in this doc. I would change description to something like "Key for the graceful restart in HA mode", also we can add link to IEP

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, do we need the same mechanism in ZoneRebalanceUtil for the purposes of collocation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the javadoc.
For ZoneRebalanceUtil please raise a separate jira

Copy link
Contributor

@sanpwc sanpwc left a comment

Choose a reason for hiding this comment

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

I'd rather add some unit tests, however integration ones, that you wrote cover major scenarious. Anyway, if you will decide to add some unit tests, please don't do it with given ticket and please postpone the active until you will return from holidays.

Generally PR is good.


/** Chain of assignments. */
@IgniteToStringInclude
private final List<Assignments> chain;
Copy link
Contributor

Choose a reason for hiding this comment

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

I though that you have a wrapper for Assignments that we may use to store configurationIndex in. If not - not a problem, we will add one within https://issues.apache.org/jira/browse/IGNITE-24106.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's do it in IGNITE-24106.

@@ -1234,6 +1242,295 @@ void testTwoPhaseResetOnEmptyNodes() throws Exception {
assertPlannedAssignments(node0, partId, assignments13);
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please run given and other tests in the class with @RepeatedTest locally in order to verify that they are stable?


@Test
@ZoneParams(nodes = 7, replicas = 7, partitions = 1, consistencyMode = ConsistencyMode.HIGH_AVAILABILITY)
void testSecondResetRewritesFirst() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

The name is misleading. second phaze of reset should rewrite first one, on the other hand second reset(full) should append to the first one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what about testSecondResetRewritesUnfinishedFirstPhaseReset?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@Retention(RetentionPolicy.RUNTIME)
@interface ZoneParams {
int replicas();

int partitions();

int nodes() default INITIAL_NODES;

ConsistencyMode consistencyMode() default ConsistencyMode.STRONG_CONSISTENCY;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say that we miss:

  1. Verification that graceful change will rewrite chain after force resets.
  2. Verification that !HA zone has empty chain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

/**
* {@link VersionedSerializer} for {@link AssignmentsChain} instances.
*/
public class AssignmentsChainSerializer extends VersionedSerializer<AssignmentsChain> {
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing that I forgot to mention: please add unit tests for this class, including one that will check that serialization made with the current code can be later deserialized (there are examples named approximately v1CanBeDeserialized() in each XXXSerializerTest)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

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.

4 participants