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

Allow setting metadata before registering to Eureka #13

Merged
merged 3 commits into from
Aug 20, 2014

Conversation

jianfeiliao
Copy link

Eureka has problem to replicate metadata when there are multiple instances. By setting the metadata before the registration, and only send the metadata once in one POST call, we can avoid the corruption to the metadata.

I worked with @cquinn on this, and this is the approach he used in Netflix.

@cquinn
Copy link
Contributor

cquinn commented Aug 19, 2014

Eureka doesn't support sub-record syncing, so with fargo's round-robin server selection, and the use of post-registration metadata PUTing, we get corrupted metadata as it is written piecemeal to different servers and then the last one stomps the others. Allowing pre-registration metadata setting allows registration to work like it does at Netflix: it's all set once before the POST, and never updated later.

Fixing the server selection is another approach, but this fix is better all around for metadata handling, and makes server selection less critical.

The original Add* method should still work the same way, and is fairly safe if only one item is set between sync windows.

@ryansb
Copy link
Contributor

ryansb commented Aug 19, 2014

I wasn't aware that the round-robin led to update-stomping. I'll review this ASAP.

@ryansb
Copy link
Contributor

ryansb commented Aug 20, 2014

This change looks good to me. 👍

@tysonstewart
Copy link
Contributor

Looks great. Thank you!

tysonstewart pushed a commit that referenced this pull request Aug 20, 2014
Allow setting metadata before registering to Eureka
@tysonstewart tysonstewart merged commit 865b445 into hudl:master Aug 20, 2014
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.

4 participants