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

GEODE-10421: Improve start gw sender with clean-queue #7856

Merged
merged 4 commits into from
Sep 16, 2022

Conversation

mivanac
Copy link
Contributor

@mivanac mivanac commented Sep 13, 2022

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

  • Has your PR been rebased against the latest commit within the target branch (typically develop)?

  • Is your initial contribution a single, squashed commit?

  • Does gradlew build run cleanly?

  • Have you written or updated unit tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

@mivanac mivanac marked this pull request as ready for review September 13, 2022 19:33
@mivanac mivanac changed the title GEODE-10421: added check gw status GEODE-10421: Improve start gw sender with clean-queue Sep 14, 2022
@mivanac mivanac force-pushed the feature/GEODE-10421 branch from eb9d926 to 0de7aab Compare September 14, 2022 10:30
@mivanac mivanac requested a review from mkevo September 14, 2022 17:55
@mivanac
Copy link
Contributor Author

mivanac commented Sep 14, 2022

@jvarenina could you review this PR. Hope you will soon become commiter.

Comment on lines 82 to 86
Set<DistributedMember> allServers = findMembers(null, null);

if (dsMembers.size() != allServers.size()) {
return ResultModel.createError(CliStrings.EXECUTE_ON_ALL_MEMBERS);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This code will reject a start clean queue command when you execute it for a particular group of servers when there are multiple groups of servers. Could it be possible to check that only servers in the provided group have configured senders and continue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for comment. It seems if partitioned region is created on just a group of servers, this check is not valid.

Comment on lines 97 to 117
if (cache.getDistributedSystem().getDistributedMember().getId().equals(member.getId())) {
bean = service.getLocalGatewaySenderMXBean(senderId);
} else {
ObjectName objectName = service.getGatewaySenderMBeanName(member, senderId);
bean = service.getMBeanProxy(objectName, GatewaySenderMXBean.class);
}
if (bean != null) {
if (bean.isRunning()) {
commmandRejected = true;
rejectResultData.addMemberStatusResultRow(member.getId(), CliStrings.GATEWAY_ERROR,
CliStrings.format(
CliStrings.GATEWAY_SENDER_0_IS_ALREADY_STARTED_ON_MEMBER_1, id,
member.getId()));
}
} else {
commmandRejected = true;
rejectResultData.addMemberStatusResultRow(member.getId(), CliStrings.GATEWAY_ERROR,
CliStrings.format(
CliStrings.GATEWAY_SENDER_0_IS_NOT_AVAILABLE_ON_MEMBER_1, id, member.getId()));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The same checks are performed just a few lines below in callable objects which execute the command on a member. Do we need still need those checks? Or, If they are required, is it possible to create a function that encapsulates them to avoid duplicated code?

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 check needs to be executed prior to execution of callables, since they are executed in parallel on all desired members.

@mivanac mivanac requested a review from jvarenina September 15, 2022 16:15
if (cleanQueues) {

GatewaySenderMXBean bean;
boolean commmandRejected = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

Copy link
Contributor

@jvarenina jvarenina left a comment

Choose a reason for hiding this comment

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

Looks good to me. No further commands from my side.

@mivanac mivanac force-pushed the feature/GEODE-10421 branch from c195549 to a81ac68 Compare September 16, 2022 07:52
@mivanac mivanac merged commit c4e5a03 into apache:develop Sep 16, 2022
mkevo pushed a commit to Nordix/geode that referenced this pull request Oct 27, 2022
* GEODE-10421: added check gw status

* GEODE-10421: added TC

* GEODE-10421: add document impacts

* GEODE-10421: update after comments
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