-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Make pserver able to get server index without etcd (decouple pserver with etcd) #2634
Conversation
c8296be
to
175015b
Compare
…with etcd) The pserver need to have server index for saving model on the distributed file system. The server index comes from etcd if etcd is used, or user can manually specify them. So we need pserver.NewService() to take index as an argument. Since index could come from etcd, it would be strange if pserver takes an index as argument, at the same time get the index from etcd. so we will need to decouple pserver with etcd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -31,7 +30,7 @@ func init() { | |||
port[i] = p | |||
|
|||
go func(l net.Listener) { | |||
s, err := pserver.NewService("", time.Second*5) | |||
s, err := pserver.NewService(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't catch up what 0 meaning here, pserver index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad, I found it in the bottom. maybe add some comment here is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe if develop is confused, he can check the definition of pserver.NewService
:) Please let me know if you think otherwise.
return pserverIdx, nil | ||
} | ||
|
||
func (e *EtcdClient) initDesiredPsercers(ctx context.Context, numPservers int) (*clientv3.TxnResponse, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a typo here
initDesiredPservers
The pserver need to have server index for saving model on the
distributed file system. The server index comes from etcd if etcd is
used, or user can manually specify them. So we need
pserver.NewService() to take index as an argument. Since index could
come from etcd, it would be strange if pserver takes an index as
argument, at the same time get the index from etcd. so we will need to
decouple pserver with etcd.