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

Batching of snapshot state updates #10295

Closed
wants to merge 1 commit into from

Conversation

ywelsch-t
Copy link

Similar to the batching of "shards-started" actions, this PR implements batching of snapshot status updates. This is useful when backing up many indices as the cluster state does not need to be republished as many times.

@javanna javanna added :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs review labels Mar 27, 2015
@imotov
Copy link
Contributor

imotov commented Mar 27, 2015

@ywelsch-t have you signed CLA? I cannot find your name there for some reason.

@ywelsch-t
Copy link
Author

@imotov I'm clearing things with our legal department. Will probably take a week. Sorry for that.

@imotov
Copy link
Contributor

imotov commented May 8, 2015

@ywelsch-t any news?

@ywelsch-t
Copy link
Author

The CLA has been signed last Friday.

@@ -459,40 +464,73 @@ public RestoreInfo getRestoreInfo() {
* @param request update shard status request
*/
private void innerUpdateRestoreState(final UpdateIndexShardRestoreStatusRequest request) {
logger.debug("received updated snapshot restore state [{}]", request);
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be logged for every single shard. So, I think it might be better to make it TRACE.

@imotov
Copy link
Contributor

imotov commented May 13, 2015

@ywelsch-t Indeed the CLA was signed. Thanks a lot for PR. I have reviewed it and left a few comments. Could you also add a test that would verify that shard updates are indeed batching?

@ywelsch-t
Copy link
Author

@imotov Thanks for the feedback. I have incorporated all your suggestions. I do not know however how to test that batching indeed occurs (only validated it manually). I looked at the batching of "shard started" actions (which inspired this PR), but could not find a test case to draw inspiration from.

}
assert !batchedRestoreInfo.containsKey(entry.snapshotId());
batchedRestoreInfo.put(entry.snapshotId(),
new Tuple<RestoreInfo, Map<ShardId, ShardRestoreStatus>>(
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be just new Tuple<>(

@imotov
Copy link
Contributor

imotov commented May 15, 2015

@ywelsch-t I think we are getting there. I left a few minor comments. I think for the test we can do something like this: https://gist.github.com/imotov/6460fe90ffd3678573d7 What do you think?

@ywelsch-t
Copy link
Author

Test looks good to me (thanks for the help!). If all is good, I can squash the commits and add a proper commit message.

@imotov
Copy link
Contributor

imotov commented May 18, 2015

@ywelsch-t great, please also rebase against current master after squashing.

@ywelsch-t
Copy link
Author

@imotov done

@imotov
Copy link
Contributor

imotov commented May 20, 2015

@ywelsch-t thanks! I was about to push it to the master, but then I noticed that the test fails from time to time. I will try to figure out and fix it tomorrow and then push.

@imotov imotov closed this in 14c1743 May 21, 2015
imotov pushed a commit that referenced this pull request May 21, 2015
Similar to the batching of "shards-started" actions, this commit implements batching of snapshot status updates. This is useful when backing up many indices as the cluster state does not need to be republished as many times.

Closes #10295
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.

3 participants