9 static thread_local std::mutex copy_mutex;
10 std::unique_lock<std::mutex> lock(copy_mutex);
12 memcpy(const_cast<node_id_t*>(
changes[local_row]),
13 const_cast<const node_id_t*>(old_sst.
changes[row] + num_changes_installed),
16 memcpy(const_cast<uint32_t*>(
joiner_ips[local_row]),
17 const_cast<const uint32_t*>(old_sst.
joiner_ips[row] + num_changes_installed),
18 (old_sst.
joiner_ips.
size() - num_changes_installed) *
sizeof(uint32_t));
20 const_cast<const uint16_t*>(old_sst.
joiner_gms_ports[row] + num_changes_installed),
23 const_cast<const uint16_t*>(old_sst.
joiner_rpc_ports[row] + num_changes_installed),
26 const_cast<const uint16_t*>(old_sst.
joiner_sst_ports[row] + num_changes_installed),
29 const_cast<const uint16_t*>(old_sst.
joiner_rdmc_ports[row] + num_changes_installed),
49 static thread_local std::mutex copy_mutex;
50 std::unique_lock<std::mutex> lock(copy_mutex);
51 memcpy(const_cast<node_id_t*>(
changes[local_row]),
52 const_cast<const node_id_t*>(
changes[other_row]),
54 memcpy(const_cast<uint32_t*>(
joiner_ips[local_row]),
55 const_cast<const uint32_t*>(
joiner_ips[other_row]),
78 for(uint row = 0; row < num_rows; ++row) {
79 s <<
"row=" << row <<
" ";
80 s <<
"vid=" <<
vid[row] <<
" ";
83 s << (
suspected[row][n] ?
"T" :
"F") <<
" ";
86 s <<
"}, num_changes=" <<
num_changes[row] <<
", num_committed=" 89 for(
int n = 0; n < (
num_changes[row] - num_installed[row]); ++n) {
92 s <<
"}, num_acked= " <<
num_acked[row] <<
", num_received={ ";
96 s <<
"}, joiner_ips={ ";
97 for(
int n = 0; n < (
num_changes[row] - num_installed[row]); ++n) {
100 s <<
"}, joiner_gms_ports={ ";
101 for(
int n = 0; n < (
num_changes[row] - num_installed[row]); ++n) {
104 s <<
"}, joiner_rpc_ports={ ";
105 for(
int n = 0; n < (
num_changes[row] - num_installed[row]); ++n) {
108 s <<
"}, joiner_sst_ports={ ";
109 for(
int n = 0; n < (
num_changes[row] - num_installed[row]); ++n) {
112 s <<
"}, joiner_rdmc_ports={ ";
113 for(
int n = 0; n < (
num_changes[row] - num_installed[row]); ++n) {
116 s <<
"}, seq_num={ ";
121 <<
", delivered_num={ ";
126 <<
", wedged = " << (
wedged[row] ?
"T" :
"F") <<
", global_min = { ";
131 s <<
"}, global_min_ready= { ";
136 <<
", rip = " <<
rip[row] << std::endl;
149 void set(
volatile char* string_array,
const std::string& value) {
150 strcpy(const_cast<char*>(string_array), value.c_str());
151 std::atomic_signal_fence(std::memory_order_acq_rel);
161 std::atomic_signal_fence(std::memory_order_acq_rel);
164 bool equals(
const volatile char* string_array,
const std::string& value) {
165 return strcmp(const_cast<const char*>(string_array), value.c_str()) == 0;
unsigned int get_local_index() const
Gets the index of the local row in the table.
SSTFieldVector< bool > global_min_ready
Array indicating whether each shard leader (indexed by subgroup number) has published a global_min fo...
SSTField< int > num_changes
How many changes to the view have been proposed.
SSTField< bool > wedged
Set after calling rdmc::wedged(), reports that this member is wedged.
SSTFieldVector< uint16_t > joiner_gms_ports
joiner_xxx_ports are the port numbers for the joining nodes.
SSTFieldVector< uint16_t > joiner_sst_ports
unsigned int get_num_rows() const
Returns the total number of rows in the table.
SSTField< int32_t > vid
View ID associated with this SST.
SSTFieldVector< message_id_t > seq_num
Sequence numbers are interpreted like a row-major pair: (sender, index) becomes sender + num_members ...
void increment(volatile int &member)
Thread-safe increment of an integer member of GMSTableRow; ensures there is a std::atomic_signal_fenc...
std::string to_string() const
Creates a string representation of the local row (not the whole table).
SSTField< int > num_acked
How many proposed changes have been seen.
void init_local_row_from_previous(const DerechoSST &old_sst, const int row, const int num_changes_installed)
Initializes the local row of this SST based on the specified row of the previous View's SST...
SSTFieldVector< message_id_t > delivered_num
This represents the highest sequence number that has been delivered at this node. ...
SSTField< int > num_installed
How many previously proposed view changes have been installed in the current view.
SSTFieldVector< uint16_t > joiner_rdmc_ports
SSTFieldVector< int32_t > num_received
Local count of number of received messages by sender.
size_t size() const
Just like std::vector::size(), returns the number of elements in this vector.
uint32_t node_id_t
Type alias for Node IDs in a Derecho group.
SSTField< bool > rip
to signal a graceful exit
The GMS and derecho_group will share the same SST for efficiency.
void init_local_change_proposals(const int other_row)
Copies currently proposed changes and the various counter values associated with them to the local ro...
bool equals(const volatile char *string_array, const std::string &value)
SSTFieldVector< uint32_t > joiner_ips
If changes[i] is a Join, joiner_ips[i] is the IP address of the joining node, packed into an unsigned...
SSTFieldVector< int > global_min
Array of how many messages to accept from each sender in the current view change. ...
SSTFieldVector< uint16_t > joiner_rpc_ports
SSTFieldVector< node_id_t > changes
An array of the same length as View::members, containing a list of proposed changes to the view that ...
SSTField< int > num_committed
How many proposed view changes have reached the commit point.
SSTFieldVector< bool > suspected
Array of same length as View::members, where each bool represents whether the corresponding member is...