question history:
question 
85 views

Question on how ECS initializes servers

Hi, for milestone2, when the ECS is started, it's supposed to initialize at least one server right? How is this done?

In the M2 spec, it says that

"KVServers are started using the ECS as a bootstrap server and provide the KVServer interface at the specified IP and port. (e.g., -b 192.168.1.24:5144 -a 192.168.1.24 -p 5153). "

But then how can client know which server is initialized (since in our pipeline, the client and ECS do not communicate with each other)? 

Can we do this through loading a set of pre-defined name, host, and port of a for the servers specified in a configuration file (e.g. config.txt) so both Client and ECS would have access to this information?

Thanks!

 2
Updated by Anonymous Calc

the students' answer,

where students collectively construct a single answer

You can assume that kvClient knows at least one kvServer.

Either predefine it in a config file or, as M1, we type "connect serveraddress port" in the kvClient CLI to connect to one kvServer.

The client then can start get/put commands, if the server responds SERVER_NOT_RESPONSIBLE. The client backend, kvStore, then can issue a "keyrange" message to the kvServer.

The kvServer then replies keyrange_success with the entire hashring information:

keyrange_success 6aa27ce2f47205...,98f6bcd4621d3...6,192.168.1.2:5120; 98f6bcd4621...7,a3...,192.168.1.3:5120; … \r\n”

Once, you have this information, you know the entire map of all kvServers addresses and ports.

More info: @117

 1
Updated by Luke
followup discussionsfor lingering questions and comments
Minghao Li 

Should we consider the scenario where the primary server that the client always knows is shut off? If so, do the client just treat the next server on the key range as the primary server? Also, what if the primary is shut down while no other servers are left, how should the client be introduced to other servers then? Thanks

 0
Luke

1. the scenario where the primary server that the client always knows is shut off?

It's possible.

If the only server that the client knows is down and the client does not know any alternative option from its cached keyrange/metadata, and you also do not know other server address to connect, it's single point of failure and there is no other way to continue.

2.If so, do the client just treat the next server on the key range as the primary server? 

Yes. If the client knows the keyrange/metadata, and there are other choices, the client can pick any other server to continue the work.

3. What if the primary is shut down while no other servers are left, how should the client be introduced to other servers then

There is no other way to continue. Unless, you know another server address to connect in your mind/notebook.

I'm reluctant to call any server as the "primary" server. All of the kvServers are equal. It's just the first server you connect to. It's no longer special once you get your first metadata.

 0