Skip to content
This repository was archived by the owner on Sep 22, 2020. It is now read-only.

Comments

SyncCluster: Skip empty cluster updates.#214

Merged
yichengq merged 1 commit intocoreos:masterfrom
aluzzardi:sync-cluster-no-members
Jun 5, 2015
Merged

SyncCluster: Skip empty cluster updates.#214
yichengq merged 1 commit intocoreos:masterfrom
aluzzardi:sync-cluster-no-members

Conversation

@aluzzardi
Copy link
Contributor

This change prevents doing an "empty" cluster update.

When etcd is not yet fully initialized, it tends to return an empty list of members.

Since internalSyncCluster uses the result of the previous run (it iterates over cluster.Machines which is also filled by internalSyncCluster), it means that if we do an empty update the client is forever broken: c.cluster.Machines will be empty therefore further calls to SyncCluster will be a no-op.

Signed-off-by: Andrea Luzzardi aluzzardi@gmail.com

@abronan
Copy link

abronan commented May 29, 2015

This allows us to connect to the cluster without waiting for it to be properly started (although we have an incomplete list of machines, but a periodic SyncCluster should fix this).

Tested and works fine in CI.

related to #213 (last comment)

/cc @yichengq Is there anything else that we missed about the issue and the logic behind SyncCluster?

etcd/client.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this comment

@yichengq
Copy link
Contributor

Could you update the comment for SyncCluster func too?
I think you have gotten all points in this process.

This change is reasonable IMO because nobody wants to update to a empty client urls. A better solution may be let etcd not return member info before it has been fully initialized.

lgtm

/cc @xiang90

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
@aluzzardi aluzzardi force-pushed the sync-cluster-no-members branch from 2698e87 to d31f99f Compare June 1, 2015 20:14
@aluzzardi
Copy link
Contributor Author

@yichengq Thanks, PTAL.

I agree that fixing etcd is a better solution - after all, it should never return an empty list (at the very least it should return its own address).

However, even if we did fix that, I believe we should still push this client change to handle backward compatibility.

@aluzzardi
Copy link
Contributor Author

@yichengq @xiang90: Friendly ping

@yichengq
Copy link
Contributor

yichengq commented Jun 5, 2015

lgtm. Thanks for the contribution! 🚢

yichengq added a commit that referenced this pull request Jun 5, 2015
SyncCluster: Skip empty cluster updates.
@yichengq yichengq merged commit cc90c7b into coreos:master Jun 5, 2015
@aluzzardi
Copy link
Contributor Author

Thank you!

@abronan
Copy link

abronan commented Jun 5, 2015

Thanks @yichengq! 🎈

@aluzzardi aluzzardi deleted the sync-cluster-no-members branch June 5, 2015 22:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants