-
Notifications
You must be signed in to change notification settings - Fork 684
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
Conversation
eb9d926
to
0de7aab
Compare
@jvarenina could you review this PR. Hope you will soon become commiter. |
Set<DistributedMember> allServers = findMembers(null, null); | ||
|
||
if (dsMembers.size() != allServers.size()) { | ||
return ResultModel.createError(CliStrings.EXECUTE_ON_ALL_MEMBERS); | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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())); | ||
} | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
if (cleanQueues) { | ||
|
||
GatewaySenderMXBean bean; | ||
boolean commmandRejected = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
There was a problem hiding this 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.
c195549
to
a81ac68
Compare
* GEODE-10421: added check gw status * GEODE-10421: added TC * GEODE-10421: add document impacts * GEODE-10421: update after comments
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?