hydro-project / anna

A low-latency, cloud-native KVS
Apache License 2.0
702 stars 106 forks source link

Background gossip/multicast protocol #32

Closed authwork closed 4 years ago

authwork commented 4 years ago

@vsreekanti Hello, I have a question about Background gossip/multicast protocol. In Anna: The user requests will be handled by user_request_handler. If the type is PUT, it records it in local_changeset for gossip sync periodically.

if (local_changeset.size() > 0) {
        .....
        // fetch current state from DB and this is a "PUT" request
        send_gossip(addr_keyset_map, pushers, serializers, stored_key_map);
        local_changeset.clear();
      }

Is this "PUT" request handled by user_request_handler or gossip_handler ? If it is handled by gossip_handler, how it can achieve that (I mean how the server recongnize the PUT request is send by other replicas or the clients) ?

vsreekanti commented 4 years ago

The request is handled by the gossip_handler. The gossip_handler listens on a different port than the user_request_handler, which is how the messages are differentiated.