|
34 | 34 | static const std::string UndefinedNode{}; |
35 | 35 |
|
36 | 36 | /** |
37 | | - * Represents a tracked SyncWrite. |
| 37 | + * Represents a tracked SyncWrite. It is mainly a wrapper around a pending |
| 38 | + * Prepare item. |
38 | 39 | */ |
39 | 40 | class DurabilityMonitor::SyncWrite { |
40 | 41 | public: |
| 42 | + /** |
| 43 | + * @param (optional) cookie The cookie representing the client connection. |
| 44 | + * Necessary at Active for notifying the client at SyncWrite completion. |
| 45 | + * @param item The pending Prepare being wrapped |
| 46 | + * @param (optional) chain The repl-chain that the write is tracked against. |
| 47 | + * Necessary at Active for verifying the SW Durability Requirements. |
| 48 | + */ |
41 | 49 | SyncWrite(const void* cookie, |
42 | 50 | queued_item item, |
43 | | - const ReplicationChain& chain); |
| 51 | + const ReplicationChain* chain); |
44 | 52 |
|
45 | 53 | const StoredDocKey& getKey() const; |
46 | 54 |
|
@@ -89,19 +97,19 @@ class DurabilityMonitor::SyncWrite { |
89 | 97 |
|
90 | 98 | // This optimization eliminates the need of scanning the ACK map for |
91 | 99 | // verifying Durability Requirements |
92 | | - Monotonic<uint8_t> ackCount; |
| 100 | + Monotonic<uint8_t> ackCount{0}; |
93 | 101 |
|
94 | 102 | // Majority in the arithmetic definition: num-nodes / 2 + 1 |
95 | | - const uint8_t majority; |
| 103 | + uint8_t majority{0}; |
| 104 | + |
| 105 | + // Name of the active node in replication-chain. Used at Durability |
| 106 | + // Requirements verification. |
| 107 | + std::string active{UndefinedNode}; |
96 | 108 |
|
97 | 109 | // Used for enforcing the Durability Requirements Timeout. It is set |
98 | 110 | // when this SyncWrite is added for tracking into the DurabilityMonitor. |
99 | 111 | const boost::optional<std::chrono::steady_clock::time_point> expiryTime; |
100 | 112 |
|
101 | | - // Name of the active node in replication-chain. Used at Durability |
102 | | - // Requirements verification. |
103 | | - const std::string active; |
104 | | - |
105 | 113 | friend std::ostream& operator<<(std::ostream&, const SyncWrite&); |
106 | 114 | }; |
107 | 115 |
|
|
0 commit comments