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-22459 Implement zone Raft group listener #5134

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

Conversation

sashapolo
Copy link
Contributor

https://issues.apache.org/jira/browse/IGNITE-22459

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes


CompletableFuture<?>[] futures = zoneTables.stream()
.map(tbl -> {
CompletableFuture<Void> createStoragesFuture = runAsync(
Copy link
Contributor Author

@sashapolo sashapolo Jan 30, 2025

Choose a reason for hiding this comment

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

To reviewer: this change is needed, because there was a bug: getOrCreatePartitionStorages returns a CompletableFuture, which we wrapped in a runAsync having a double wrapped future, which means we didn't wait for the nested future to complete


clo.result(new TransactionResult(cmd.commit() ? COMMITTED : ABORTED, cmd.commitTimestamp()));
} else if (command instanceof PrimaryReplicaChangeCommand) {
// This is a hack for tests, this command is not issued in production because no zone-wide placement driver exists yet.
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need a TODO here to remove the hack later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know which ticket to use here and I don't expect us to miss this place, because it will likely not work properly when we will implement the placement driver.


processTableSpecificCommand(tablePartitionId, clo);
} else {
LOG.info("Message type " + command.getClass() + " is not supported by the zone partition RAFT listener yet");
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a WARN?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is from the previous implementation and this is temporary code anyway, this will become an assertion eventually

return Collections.singleton(value).iterator();
}

private static CommandClosure<WriteCommand> idempotentCommandClosure(CommandClosure<WriteCommand> clo) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that this is a 'no-result-propagating' closure. Why is it called idempotent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is that you can call result many times and it will not affect the state of the closure) What do you propose?

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.

2 participants