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

Renew retention leases while following #39335

Merged

Conversation

jasontedor
Copy link
Member

This commit is the final piece of the integration of CCR with retention leases. Namely, we periodically renew retention leases and advance the retaining sequence number while following.

Relates #37165
Closes #38718

This commit is the final piece of the integration of CCR with retention
leases. Namely, we periodically renew retention leases and advance the
retaining sequence number while following.
@jasontedor jasontedor added v7.0.0 :Distributed Indexing/CCR Issues around the Cross Cluster State Replication features v6.7.0 v8.0.0 v7.2.0 labels Feb 23, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@jasontedor jasontedor mentioned this pull request Feb 23, 2019
24 tasks
Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

I left a question and two small nits but this looks really good. Thanks @jasontedor.

* lease back. After that listener returns, we can check to see if a retention lease exists on the leader.
*
* Note, this done mean that listener will fire twice, once in our onResponseReceived hook, and once after our onResponseReceived
* callback returns. 🤷‍♀️
Copy link
Member Author

Choose a reason for hiding this comment

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

@tbrooks8 Is there a better way?

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM - Great to see the last piece of the machinery being added!

@@ -151,6 +158,14 @@ void start(
coordinateReads();
});
});

synchronized (this) {
renewable = scheduleBackgroundRetentionLeaseRenewal(() -> {
Copy link
Member

Choose a reason for hiding this comment

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

Can this code be placed under the existing synchronized block in the start() method?

Copy link
Member Author

Choose a reason for hiding this comment

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

I pushed a commit that does this.

@jasontedor jasontedor merged commit 176c157 into elastic:master Feb 25, 2019
jasontedor added a commit that referenced this pull request Feb 25, 2019
This commit is the final piece of the integration of CCR with retention
leases. Namely, we periodically renew retention leases and advance the
retaining sequence number while following.
jasontedor added a commit that referenced this pull request Feb 25, 2019
This commit is the final piece of the integration of CCR with retention
leases. Namely, we periodically renew retention leases and advance the
retaining sequence number while following.
jasontedor added a commit that referenced this pull request Feb 25, 2019
This commit is the final piece of the integration of CCR with retention
leases. Namely, we periodically renew retention leases and advance the
retaining sequence number while following.
@jasontedor jasontedor deleted the ccr-retention-lease-renewal-while-following branch February 26, 2019 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent CCR followers from falling fatally far behind
7 participants