Commit Graph

105 Commits

Author SHA1 Message Date
Gleb Natapov
8d9fb8a96c message: consolidate send_message() and send_message_oneway()
send_message() and send_message_oneway() are almost identical, implement
the later in terms of the former. The patch also fixes send_message() to
work properly with MsgIn = void.

Reviewed-by: Asias He <asias@cloudius-systems.com>
2015-05-13 13:41:24 +03:00
Asias He
bbb4b90542 gms: Use unordered_map for endpoint_state_map
We do not really care about order.
2015-05-11 11:27:06 +03:00
Asias He
f12e955b4e message: Drop register_handler_oneway 2015-05-07 13:16:18 +03:00
Asias He
177498375d gossip: Add storage_service_value_factory helper
Switch to use real version when storage_service is ready.
2015-05-07 15:29:46 +08:00
Asias He
7ac5277822 gossip: Fix link error with versioned_value
With the next patch "gossip: Add storage_service_value_factory helper"
in this series.

[asias@hjpc urchin]$ ninja-build

[8/10] LINK build/release/seastar

build/release/gms/gossiper.o: In function
`gms::versioned_value::versioned_value_factory::removing_nonlocal(utils::UUID
const&)':
/home/asias/src/cloudius-systems/urchin/./gms/versioned_value.hh:201:
undefined reference to `gms::versioned_value::DELIMITER_STR'
build/release/gms/gossiper.o: In function
`gms::versioned_value::versioned_value_factory::removal_coordinator(utils::UUID
const&)':
/home/asias/src/cloudius-systems/urchin/./gms/versioned_value.hh:211:
undefined reference to `gms::versioned_value::DELIMITER_STR'
build/release/gms/gossiper.o: In function
`gms::versioned_value::versioned_value_factory::removed_nonlocal(utils::UUID
const&, long)':
/home/asias/src/cloudius-systems/urchin/./gms/versioned_value.hh:206:
undefined reference to `gms::versioned_value::DELIMITER_STR'
/home/asias/src/cloudius-systems/urchin/./gms/versioned_value.hh:206:
undefined reference to `gms::versioned_value::DELIMITER_STR'
collect2: error: ld returned 1 exit status

Fix by defining the symbol in gms/versioned_value.cc.
2015-05-07 15:29:13 +08:00
Asias He
f689ef705a gossip: Forward gossip message to cpu0
There is one gossiper instance per node and it runs on cpu0 only. We can
not guarantee there will always be a core to core tcp connection within
messaging service, so messaging service needs to listen on all cpus.
When a remote node connects to local node with a connection bound to cpu
other than cpu0, we need to forward this message to cpu0.
2015-05-05 10:56:55 +03:00
Asias He
bf3d6a4c06 gossip: Disable sleep and retry logic in do_status_check
We do not have the ThreadPoolExecutor logic. Disable the sleep and retry
logic.
2015-04-23 14:55:26 +08:00
Asias He
0060eac413 gossip: Set last processed time when receiving gossip message 2015-04-23 14:55:26 +08:00
Asias He
622ec0111d gossip: Fix apply_new_states
We should take a reference, otherwise remote's endpoint_state will not
be updated locally.
2015-04-23 14:55:26 +08:00
Asias He
5f0050dc97 gossip: Fix add_application_state
If the key exists, we should update the new value.
2015-04-23 14:55:26 +08:00
Asias He
7b75df6bd4 gossip: Update heart beat 2015-04-23 14:55:26 +08:00
Asias He
f2e840de54 gossip: Switch from fail to warn
Warn is enough for now.
2015-04-23 14:55:26 +08:00
Asias He
a800fbfe64 gossip: Set get_phi_convict_threshold to 8
It is the default value.
2015-04-23 14:55:26 +08:00
Asias He
b38dae4a2b gossip: Dump failure detector info 2015-04-20 15:49:27 +08:00
Asias He
7e0a0c381f gossip: Remove debug print message 2015-04-20 15:49:27 +08:00
Gleb Natapov
c39af6dda0 gossip: store regular pointer to subscribers instead of shared one
Some subscribers are allocated statically, so it is a churn to make
shared pointers from them. And since registered subscribers have to be
unregister before been destroyed anyway there is no lifetime issue here
that require use of a smart pointer.
2015-04-20 09:18:23 +03:00
Asias He
02f8c9d965 gossip: Add dump_endpoint_state_map for debug 2015-04-16 17:44:20 +08:00
Asias He
4abee75c04 gossip: Drop fail guard in mark_alive and apply_state_locally 2015-04-16 17:44:20 +08:00
Asias He
4cffb5513d gossip: Drop unnecessary FIXME 2015-04-16 17:44:20 +08:00
Asias He
7f98644742 gossip: Fix send_gossip
Insert when local_ep_state_ptr is engaged not otherwise.
2015-04-16 17:08:19 +08:00
Asias He
eeafdf5815 gossip: Make gms::versioned_value::load static
We are supposed to call it without an instance.
We will convert other similar functions in follow up patches.
2015-04-16 17:03:46 +08:00
Asias He
d661827045 gossip: Fix get_broadcast_address
It is default to listen_address.
2015-04-16 17:01:52 +08:00
Asias He
adff3b9c79 gossip: Drop redundant print in heart_beat_state 2015-04-16 16:59:53 +08:00
Asias He
b18a7bf6c8 gossip: Fix namespace of get_next_version 2015-04-16 14:58:52 +08:00
Asias He
0a1fffa443 gossip: Use get_cluster_name and get_partitioner_name helper 2015-04-16 14:58:52 +08:00
Asias He
e60f1db994 gossip: Drop two hacks which were used to test before 2015-04-16 14:58:52 +08:00
Asias He
8705077517 gossip: Pass reference in send_all and request_all 2015-04-16 14:58:52 +08:00
Asias He
0ffa75f3b7 gossip: Allow specify seeds node IP address 2015-04-16 14:58:52 +08:00
Gleb Natapov
1dbad40513 gossip: add missing namespace
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2015-04-15 22:37:30 +03:00
Asias He
650e69da9e gossip: Reduce header inclusion for gms/failure_detector.hh 2015-04-15 15:03:29 +08:00
Asias He
fc72506f68 gossip: Add gms/failure_detector.cc
Move code from failure_detector.hh to failure_detector.cc
2015-04-15 15:03:29 +08:00
Asias He
9a7546c170 gossip: Add copyright to gms/gossiper.cc 2015-04-15 15:03:29 +08:00
Asias He
494b8d61ff gossip: Reduce header inclusion 2015-04-15 15:03:29 +08:00
Asias He
eed2795abe gossip: Move code from gossiper.hh to gossiper.cc 2015-04-15 15:03:29 +08:00
Asias He
83f3199568 gossip: Use get_broadcast_address() helper 2015-04-15 15:03:29 +08:00
Asias He
5bf282c56b gossip: Drop #if 0'ed code which is converted already 2015-04-13 15:26:18 +08:00
Asias He
5cf9fbebc0 gossip: Switch to use get_cluster_name and get_partitioner_name 2015-04-13 15:20:37 +08:00
Asias He
bd16d9e291 gossip: Add cluster_id() and partioner() helper for gossip_digest_syn 2015-04-13 15:19:51 +08:00
Asias He
a2af07ba71 gossip: Convert do_shadow_round 2015-04-13 15:14:09 +08:00
Asias He
16deb4af35 gossip: Add get_cluster_name and get_partitioner_name helper
DatabaseDescriptor.getClusterName and .getPartitionerName
are not ready. Add helpers to wrap them up.
2015-04-13 15:12:04 +08:00
Asias He
d7f053a494 gossip: Implement GossipDigestSynVerbHandler 2015-04-13 14:31:02 +08:00
Asias He
3809934a05 gossip: Add operator< for gossip_digest 2015-04-13 14:31:02 +08:00
Asias He
e21d38684d gossip: Add default constructor for gossip_digest 2015-04-13 14:31:02 +08:00
Asias He
005a88699f gossip: Remove const for gossip_digest 2015-04-13 14:31:02 +08:00
Asias He
c1325f8cbe gossip: Implement GossipDigestAckVerbHandler 2015-04-13 14:31:02 +08:00
Asias He
7ee239e7e7 gossip: Implement GossipDigestAck2VerbHandler 2015-04-13 14:31:02 +08:00
Asias He
1ad7af3bca gossip: Initial hook of gossip and messaging_service
Register the handler of gossip verbs using ms::register_handler.
Implement send_gossip using ms::send_message. The handlers are only
placeholders for now. Will implement them later.

A periodic timer (1 seconds) is added to send gossip message
periodically.
2015-04-13 14:31:02 +08:00
Asias He
5dc18de0f8 gossip: Move some of gms/gossiper.hh code to gms/gossiper.cc
This makes it possible to call get_local_failure_detector() in gossiper.
Otherwise there is a cyclic dependency between gms/gossiper.hh and
gms/failure_detector.hh
2015-04-13 14:30:52 +08:00
Asias He
1174e33c88 gossip: Add operator<< for gossip_digest_ack2 2015-04-09 10:54:17 +08:00
Asias He
76d00378d7 gossip: Add operator<< for gossip_digest_ack 2015-04-09 10:54:17 +08:00