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-5828: fixes replicates miss transaction commit. #2571

Merged
merged 2 commits into from Oct 5, 2018

Conversation

pivotal-eshu
Copy link
Contributor

  • Always send CommitProcessQueryMessage to other replicates to see if anyone received second
    message as transaction originator for client transaction will be different from transaction host.
  • Do not wait for transaction originator to depart when processing CommitProcessQueryMessage if
    transaction host is crashed. Originator may not be the same as the crashed transaction host and
    never departs from the distributed system.

 * Always send CommitProcessQueryMessage to other replicates to see if anyone received second message
   as transaction originator for client transaction will be different from transation host.
 * Do not wait for transaction originator to depart when transaction host is crashed. Originator may
   not be the same as the crashed transaction host and never departs from distributed system.
@@ -1979,7 +1978,7 @@ public void memberDeparted(DistributionManager distributionManager,
if (!getSender().equals(id)) {
return;
}
this.dm.removeMembershipListener(this);
getDm().removeMembershipListener(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of "getDm()" use the parameter "distributionManager"

return farSiders;
}

DistributionManager getDm() {
Copy link
Contributor

Choose a reason for hiding this comment

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

rename "getDm" to "getDistributionManager"

}

void doCommitProcessQuery(final InternalDistributedMember id) {
final TXCommitMessage message = TXCommitMessage.this;
Copy link
Contributor

Choose a reason for hiding this comment

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

What class is this method "doCommitProcessQuery" on? I think it is TXCommitMessage.
So no need for this funny business of "TXCommitMessage.this" which was needed before because is was in an anonymous inner class.
Now everywhere you have "message" you can just have "this".
I already did this refactoring in the pull request that removes thread groups.
I would suggest for your fix not to refactor this chunk of code into its own method. Just delete the block of code from it that you want. That way it will be more clear what you are fixing and you will not have conflicts with the thread refactoring 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.

You are right that it is no longer in inner class. Cleaned up the code.

}

boolean foundTxInProgress(TXCommitMessage message) {
if (null != message && message.isProcessing()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

simplify to: return null != message && message.isProcessing();

@@ -1979,7 +1978,7 @@ public void memberDeparted(DistributionManager distributionManager,
if (!getSender().equals(id)) {
return;
}
this.dm.removeMembershipListener(this);
getDistributionManager().removeMembershipListener(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be better to just use the "distributionManager" parameter. At some point we may find that this class no longer needs to keep a reference to the dm in an instance field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will address this concern with additional dunit test.

@@ -1837,7 +1836,7 @@ public CommitProcessQueryMessage(Object trackerKey, int processorId) {

@Override
protected void process(ClusterDistributionManager dm) {
final boolean processMsgReceived = txTracker.commitProcessReceived(this.trackerKey, dm);
final boolean processMsgReceived = txTracker.commitProcessReceived(this.trackerKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the old code was better that passed along the "dm" parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

txTracker.commitProcessReceived method no longer need distribution manager anymore.

@pivotal-eshu pivotal-eshu merged commit db8ba67 into develop Oct 5, 2018
@pivotal-eshu pivotal-eshu deleted the feature/GEODE-5828 branch October 5, 2018 17:36
agingade pushed a commit to agingade/geode that referenced this pull request Jan 10, 2019
 * Always send CommitProcessQueryMessage to other replicates to see if anyone received second message
   as transaction originator for client transaction will be different from transation host.
 * Do not wait for transaction originator to depart when transaction host is crashed. Originator may
   not be the same as the crashed transaction host and never departs from distributed system.

 (cherry picked from commit db8ba67)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants